From 08437b7ac28d8e9abe8cb886a2f81876254ff18c Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Tue, 14 Jan 2025 15:53:01 +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 | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index 34c7c9ce..a5dcb84e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version_range=[4,) mod_id=sophisticatedbackpacks mod_name=Sophisticated Backpacks mod_license=GNU General Public License v3.0 -mod_version=3.22.3 +mod_version=3.22.4 mod_group_id=sophisticatedbackpacks mod_authors=P3pp3rF1y, Ridanisaurus mod_description=Fancy and functional backpacks. 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 95790bd0..df4aa1d3 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/render/BackpackItemStackRenderer.java @@ -12,7 +12,6 @@ import net.minecraft.client.resources.model.BakedModel; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.client.ClientHooks; import net.p3pp3rf1y.sophisticatedbackpacks.backpack.wrapper.BackpackWrapper; import net.p3pp3rf1y.sophisticatedbackpacks.backpack.wrapper.IBackpackWrapper; @@ -25,16 +24,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 = ClientHooks.handleCameraTransforms(matrixStack, model, transformType, leftHand); - matrixStack.translate(-0.5D, -0.5D, -0.5D); model.getRenderPasses(stack, true).forEach(bakedModel -> bakedModel.getRenderTypes(stack, true).forEach(renderType -> { VertexConsumer ivertexbuilder = ItemRenderer.getFoilBufferDirect(buffer, renderType, true, stack.hasFoil()); itemRenderer.renderModelLists(bakedModel, stack, combinedLight, combinedOverlay, matrixStack, ivertexbuilder); @@ -46,6 +37,5 @@ public void renderByItem(ItemStack stack, ItemDisplayContext transformType, Pose itemRenderer.renderStatic(displayItem.getItem(), ItemDisplayContext.FIXED, combinedLight, combinedOverlay, matrixStack, buffer, minecraft.level, 0); }); })); - } }