Skip to content

Conversation

@duzos
Copy link
Member

@duzos duzos commented Jan 24, 2026

closes #1953

@duzos duzos self-assigned this Jan 24, 2026
@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. A: Tardis Components Area: Tardis components & manager. A: Console Area: Tardis console. labels Jan 24, 2026
@duzos duzos added T: New Feature Type: New feature or content, or extending existing content. P3: Standard Priority: Default priority for repository items. D1: High Difficulty: Extensive codebase knowledge required. C: Render Changes: Might require knowledge of shaders and rendering. Branch: Staging Intended to be merged into Staging. S: Needs Testing Status: Requires testing. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 24, 2026
@duzos duzos marked this pull request as ready for review February 1, 2026 23:35
@duzos duzos requested review from a team as code owners February 1, 2026 23:35
@github-actions github-actions bot added the S: Needs Review Status: Requires additional reviews before being fully accepted. label Feb 1, 2026
@duzos duzos requested a review from Copilot February 3, 2026 00:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds per-control animations for datapack consoles, allowing console controls to have customizable animations that reflect their state. The implementation introduces a new Transformations utility class, updates the control system to support animation references, and modifies rendering logic to apply per-control animations.

Changes:

  • Added animation support to ControlTypes allowing datapack consoles to define control-specific animations
  • Implemented getTargetProgress method across all control classes to determine animation state
  • Created Transformations record to consolidate scale, offset, and rotation transformations

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tardim.geo.json New Bedrock geometry file for a TARDIS model
Transformations.java New utility class for managing model transformations (offset, scale, rotation)
ControlTypes.java Added animation reference field and updated constructor to support per-control animations
Control.java Added getTargetProgress method to determine animation progress based on control state
ControlRegistry.java Added fallback method to return a default control when lookup fails
ConsoleControlEntity.java Integrated animation state tracking and client/server synchronization for control animations
DatapackConsole.java Updated to use Transformations class and support animation inheritance from parent consoles
ClientConsoleVariantRegistry.java Enhanced texture/emission/model fallback logic with predicate-based parent lookup
ConsoleVariantRegistry.java Updated syncing to use Transformations and added null safety check for parent()
BedrockConsoleModel.java Implemented control animation application with caching and integration with console rendering
ConsoleBlockEntity.java Added client-side control entity caching with periodic refresh for animation rendering
ConsoleRenderer.java Changed render layer from EntityCutout to EntityTranslucentCull
ConsoleGeneratorRenderer.java Added model caching and reordered transformation application
BedrockExteriorModel.java Removed non-looping animation check that was logging errors
All Control implementations Implemented getTargetProgress to expose control state for animations
IncrementControl.java, IncrementManager.java Added methods to support animation progress calculation
PosControl.java Changed shouldHaveDelay to return true
PowerControl.java Removed unnecessary cast to ServerPlayerEntity
ControlAnimationState.java Deleted file (replaced by TargetedAnimationState from amblekit)
gradle.properties Updated amblekit version to support new animation features

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +20
import net.minecraft.entity.EntityDimensions;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate imports for EntityDimensions, Identifier, Vector3f, and Optional. These imports appear twice (lines 8/17, 10/18, 6/20, 22/14). Only one import for each is needed.

Suggested change
import net.minecraft.entity.EntityDimensions;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;
import org.jetbrains.annotations.Nullable;

Copilot uses AI. Check for mistakes.
Control control = entity.getControl();
if (control == null) return;

BedrockAnimation anim = this.animationCache.computeIfAbsent(entity.getControl().id(), k -> findAnimationById(entity));
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The animationCache uses the control ID as a key, but the lambda findAnimationById is only called once per control ID. If a control entity changes its animation reference, the cache will still return the old animation. Consider using a composite key that includes both the control ID and animation reference ID, or clearing the cache when animations change.

Copilot uses AI. Check for mistakes.
Comment on lines +229 to +230
if (cachedClientControls == null || this.age % CLIENT_CACHE_REFRESH_INTERVAL == 0) {
cachedClientControls = findControlEntitiesInWorld();
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client-side cache refreshes every CLIENT_CACHE_REFRESH_INTERVAL ticks (2400 = 2 minutes). This means control entities that spawn or despawn won't be reflected in animations for up to 2 minutes. Consider reducing this interval or adding a mechanism to invalidate the cache when control entities are added/removed.

Copilot uses AI. Check for mistakes.
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.unknown",
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The geometry identifier is "geometry.unknown" (line 6). This should be changed to a more descriptive and unique identifier to avoid conflicts with other models and to make debugging easier. Consider using something like "geometry.tardim" or "geometry.ait.tardim".

Copilot uses AI. Check for mistakes.
Comment on lines 82 to +93
matrices.translate(-0.5, 1.5, 0.5);
bedrockConsoleModel.applyOffsets(matrices, entity.getConsoleVariant());
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of translate and applyOffsets was swapped. The translate is now before applyOffsets (line 92 before line 93), whereas in the old code it was after. This could change the visual positioning of the console model. Please verify this reordering is intentional and doesn't break the rendering.

Suggested change
matrices.translate(-0.5, 1.5, 0.5);
bedrockConsoleModel.applyOffsets(matrices, entity.getConsoleVariant());
bedrockConsoleModel.applyOffsets(matrices, entity.getConsoleVariant());
matrices.translate(-0.5, 1.5, 0.5);

Copilot uses AI. Check for mistakes.

@Environment(EnvType.CLIENT)
public void apply(MatrixStack stack) {
stack.translate(offset.x, offset.y * -1, offset.z);
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apply method performs offset.y * -1 (line 33), but this inversion is inconsistent with how offset.x and offset.z are handled. This might be intentional for coordinate system conversion, but should be documented in a comment to explain why Y is inverted.

Copilot uses AI. Check for mistakes.
@duzos
Copy link
Member Author

duzos commented Feb 3, 2026

loser review comments

@duzos duzos requested a review from drtheodor February 4, 2026 19:13
@github-actions github-actions bot added the size/M Denotes a PR that changes 100-999 lines. label Feb 4, 2026
@duzos duzos requested a review from drtheodor February 4, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Console Area: Tardis console. A: Tardis Components Area: Tardis components & manager. Branch: Staging Intended to be merged into Staging. C: Render Changes: Might require knowledge of shaders and rendering. D1: High Difficulty: Extensive codebase knowledge required. P3: Standard Priority: Default priority for repository items. S: Needs Review Status: Requires additional reviews before being fully accepted. S: Needs Testing Status: Requires testing. size/M Denotes a PR that changes 100-999 lines. T: New Feature Type: New feature or content, or extending existing content.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

per control animations for datapack consoles

2 participants