From 777749da2e28f149dda26f108cb27fd645c6c7f3 Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Tue, 14 Jan 2025 15:54:29 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Cleaned=20up=20backpack?= =?UTF-8?q?=20stack=20rendering=20so=20that=20it=20would=20be=20more=20com?= =?UTF-8?q?patible=20with=20rendering=20that=20does=20different=20transfor?= =?UTF-8?q?mations=20than=20the=20default=20gui=20ones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../client/render/BackpackItemStackRenderer.java | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/gradle.properties b/gradle.properties index 085cce08..4d11c542 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.daemon=false mod_id=sophisticatedbackpacks mod_group_id=sophisticatedbackpacks -mod_version=3.22.1 +mod_version=3.22.2 sonar_project_key=sophisticatedbackpacks:SophisticatedBackpacks github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java index 05508e05..1abfc46e 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java @@ -14,7 +14,6 @@ import net.minecraft.client.resources.model.BakedModel; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.client.ForgeHooksClient; import net.p3pp3rf1y.sophisticatedbackpacks.api.CapabilityBackpackWrapper; public class BackpackItemStackRenderer extends BlockEntityWithoutLevelRenderer { @@ -26,16 +25,8 @@ public BackpackItemStackRenderer(BlockEntityRenderDispatcher blockEntityRenderDi @Override public void renderByItem(ItemStack stack, ItemDisplayContext transformType, PoseStack matrixStack, MultiBufferSource buffer, int combinedLight, int combinedOverlay) { - //ItemRenderer.render does transformations that would need to be transformed against in complicated way so rather pop the pose here and push the new one with the same transforms - // applied in the correct order with the getModel - matrixStack.popPose(); - matrixStack.pushPose(); ItemRenderer itemRenderer = minecraft.getItemRenderer(); BakedModel model = itemRenderer.getModel(stack, null, minecraft.player, 0); - - boolean leftHand = minecraft.player != null && minecraft.player.getOffhandItem() == stack; - model = ForgeHooksClient.handleCameraTransforms(matrixStack, model, transformType, leftHand); - matrixStack.translate(-0.5D, -0.5D, -0.5D); RenderType rendertype = ItemBlockRenderTypes.getRenderType(stack, true); VertexConsumer ivertexbuilder = ItemRenderer.getFoilBufferDirect(buffer, rendertype, true, stack.hasFoil()); itemRenderer.renderModelLists(model, stack, combinedLight, combinedOverlay, matrixStack, ivertexbuilder);