diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestVisual.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestVisual.java index 32727dc5f..341215887 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestVisual.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestVisual.java @@ -82,7 +82,6 @@ public class ChestVisual extends Abstrac if (block instanceof AbstractChestBlock chestBlock) { float horizontalAngle = blockState.getValue(ChestBlock.FACING).toYRot(); baseRotation.setAngleAxis(Math.toRadians(-horizontalAngle), 0, 1, 0); - bottom.setRotation(baseRotation); DoubleBlockCombiner.NeighborCombineResult wrapper = chestBlock.combine(blockState, level, pos, true); lidProgress = wrapper.apply(ChestBlock.opennessCombiner(blockEntity)); @@ -91,6 +90,10 @@ public class ChestVisual extends Abstrac lidProgress = $ -> 0f; } + bottom.setRotation(baseRotation); + + applyLidTransform(lidProgress.get(partialTick)); + super.init(partialTick); } @@ -126,6 +129,10 @@ public class ChestVisual extends Abstrac } lastProgress = progress; + applyLidTransform(progress); + } + + private void applyLidTransform(float progress) { progress = 1.0F - progress; progress = 1.0F - progress * progress * progress;