Skip to content

Commit

Permalink
fix: Fix auto hammer rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jun 30, 2024
1 parent 86f6668 commit e709a88
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void render(AutoHammerBlockEntity tileEntity, float partialTicks, PoseSta
poseStack.mulPose(tileEntity.getFacing().getRotation());
poseStack.mulPose(new Quaternionf(new AxisAngle4f(Math.toRadians(-90), 0f, 1f, 0f)));

if (tileEntity.shouldAnimate() || true) {
if (tileEntity.shouldAnimate()) {
tileEntity.hammerAngle += 0.4f * partialTicks;
}

Expand Down Expand Up @@ -96,15 +96,13 @@ public void render(AutoHammerBlockEntity tileEntity, float partialTicks, PoseSta

poseStack.popPose();

// TODO content is slanted inside

ItemStack currentStack = tileEntity.getCurrentStack();
if (!currentStack.isEmpty()) {
BlockState contentState = StupidUtils.getStateFromItemStack(currentStack);
if (!contentState.isAir()) {
poseStack.pushPose();
poseStack.translate(-0.09375f, 0.0625f, -0.25);
poseStack.scale(0.5f, 0.5f, 0.5f);
poseStack.translate(-0.4f, -0.04f, -0.2);
poseStack.scale(0.4f, 0.4f, 0.4f);
BlockRenderDispatcher dispatcher = Minecraft.getInstance().getBlockRenderer();
dispatcher.renderSingleBlock(contentState, poseStack, buffers, combinedLight, combinedOverlay);

Expand Down

0 comments on commit e709a88

Please sign in to comment.