Skip to content

Commit 7dfd034

Browse files
committed
Merge branch '1.20.1/dev' into 1.21.1/dev
2 parents 3e0171e + f3b0cd0 commit 7dfd034

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

common/src/vanillin/java/dev/engine_room/vanillin/visuals/ItemVisual.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public ItemVisual(VisualizationContext ctx, ItemEntity entity, float partialTick
4141
instances = new InstanceRecycler<>(() -> ctx.instancerProvider()
4242
.instancer(InstanceTypes.TRANSFORMED, model)
4343
.createInstance());
44+
45+
animate(partialTick);
4446
}
4547

4648
public static boolean isSupported(ItemEntity entity) {
@@ -53,9 +55,13 @@ public void beginFrame(Context ctx) {
5355
return;
5456
}
5557

58+
animate(ctx.partialTick());
59+
}
60+
61+
private void animate(float partialTick) {
5662
pPoseStack.setIdentity();
5763
TransformStack.of(pPoseStack)
58-
.translate(getVisualPosition(ctx.partialTick()));
64+
.translate(getVisualPosition(partialTick));
5965

6066
instances.resetCount();
6167
ItemStack itemstack = entity.getItem();
@@ -65,16 +71,17 @@ public void beginFrame(Context ctx) {
6571
boolean flag = bakedModel.isGui3d();
6672
int j = this.getRenderAmount(itemstack);
6773
float f = 0.25F;
68-
float f1 = shouldBob() ? Mth.sin(((float) entity.getAge() + ctx.partialTick()) / 10.0F + entity.bobOffs) * 0.1F + 0.1F : 0;
69-
float f2 = bakedModel.getTransforms()
70-
.getTransform(ItemDisplayContext.GROUND).scale.y();
71-
pPoseStack.translate(0.0F, f1 + 0.25F * f2, 0.0F);
72-
float f3 = entity.getSpin(ctx.partialTick());
74+
float f1 = shouldBob() ? Mth.sin(((float) entity.getAge() + partialTick) / 10.0F + entity.bobOffs) * 0.1F + 0.1F : 0;
75+
float groundScaleX = bakedModel.getTransforms().ground.scale.y();
76+
float groundScaleY = bakedModel.getTransforms().ground.scale.y();
77+
float groundScaleZ = bakedModel.getTransforms().ground.scale.y();
78+
pPoseStack.translate(0.0F, f1 + 0.25F * groundScaleZ, 0.0F);
79+
float f3 = entity.getSpin(partialTick);
7380
pPoseStack.mulPose(Axis.YP.rotation(f3));
7481
if (!flag) {
75-
float f7 = -0.0F * (float) (j - 1) * 0.5F;
76-
float f8 = -0.0F * (float) (j - 1) * 0.5F;
77-
float f9 = -0.09375F * (float) (j - 1) * 0.5F;
82+
float f7 = -0.0F * (float) (j - 1) * 0.5F * groundScaleX;
83+
float f8 = -0.0F * (float) (j - 1) * 0.5F * groundScaleY;
84+
float f9 = -0.09375F * (float) (j - 1) * 0.5F * groundScaleZ;
7885
pPoseStack.translate(f7, f8, f9);
7986
}
8087

@@ -101,7 +108,7 @@ public void beginFrame(Context ctx) {
101108
.setChanged();
102109
pPoseStack.popPose();
103110
if (!flag) {
104-
pPoseStack.translate(0.0, 0.0, 0.09375F);
111+
pPoseStack.translate(0.0, 0.0, 0.09375F * groundScaleZ);
105112
}
106113
}
107114

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ mod_homepage = https://github.com/Engine-Room/Flywheel
88
# Flywheel metadata
99
flywheel_id=flywheel
1010
flywheel_name=Flywheel
11-
flywheel_version=1.0.4-beta
11+
flywheel_version=1.0.4
1212
flywheel_description=An overhauled entity and block entity rendering API.
1313
# Vanillin metadata
1414
vanillin_id=vanillin
1515
vanillin_name=Vanillin
16-
vanillin_version=1.1.1-beta
16+
vanillin_version=1.1.1
1717
vanillin_description=Instanced rendering for entities and block entities via Flywheel.
1818
# Vanillin dependencies
1919
flywheel_maven_version_range=[1.0.0,2.0)

0 commit comments

Comments
 (0)