Skip to content

Commit

Permalink
fix: Fix hammers escaping confinement
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jun 30, 2024
1 parent 27d5091 commit 654b32d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void render(AutoHammerBlockEntity tileEntity, float partialTicks, PoseSta

// Render the hammers
poseStack.pushPose();
poseStack.translate(-0.5f, -0.15f, 0f);
poseStack.translate(-0.5f, -0.05f, 0f);
poseStack.scale(0.5f, 0.5f, 0.5f);
poseStack.pushPose();
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(Math.sin(tileEntity.hammerAngle) * 30), 0, 0, 1f)));
Expand All @@ -76,7 +76,7 @@ public void render(AutoHammerBlockEntity tileEntity, float partialTicks, PoseSta
ItemStack firstHammer = tileEntity.getUpgradeStack(0);
if (!firstHammer.isEmpty()) {
poseStack.pushPose();
poseStack.translate(0f, 0f, 0.33f);
poseStack.translate(0f, 0.1f, 0.33f);
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(10f), 0f, 1, 0)));
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(Math.sin(tileEntity.hammerAngle - 8f) * 30), 0, 0, 1f)));
itemRenderer.renderStatic(firstHammer, ItemDisplayContext.FIXED, combinedLight, combinedOverlay, poseStack, buffers, level, 0);
Expand All @@ -86,7 +86,7 @@ public void render(AutoHammerBlockEntity tileEntity, float partialTicks, PoseSta
ItemStack secondHammer = tileEntity.getUpgradeStack(1);
if (!secondHammer.isEmpty()) {
poseStack.pushPose();
poseStack.translate(0f, 0f, -0.33f);
poseStack.translate(0f, 0.1f, -0.33f);
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(-10), 0f, 1f, 0)));
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(Math.sin(tileEntity.hammerAngle + 8f) * 30), 0, 0, 1f)));
itemRenderer.renderStatic(secondHammer, ItemDisplayContext.FIXED, combinedLight, combinedOverlay, poseStack, buffers, level, 0);
Expand Down

0 comments on commit 654b32d

Please sign in to comment.