Rendering giant tools in hand and in inventory issue - Twilight Forest Unofficial (Fabric 1.20.1)
marlester-dev opened this issue ยท 3 comments
Bug Description
Without Sodium (normal):
With Sodium:
Reproduction Steps
- Install Fabric API, The Twilight Forest Unofficial, Sodium and Indium
- Log in and take the giant items out of the creative inventory
- They are not so giant anymore in hand and in inventory
I'm the dev of the mod, so you can ask me any questions you want.
Code of the mod: https://github.com/marlester-dev/twilightforest-unofficial
Possibly because of: https://github.com/marlester-dev/twilightforest-unofficial/blob/1.20.1-fabric/src/main/java/twilightforest/mixin/ItemRendererMixin.java , https://github.com/marlester-dev/twilightforest-unofficial/blob/1.20.1-fabric/src/main/java/twilightforest/client/renderer/GiantItemRenderHelper.java , https://github.com/marlester-dev/twilightforest-unofficial/blob/1.20.1-fabric/src/main/java/twilightforest/mixin/ModelLoaderMixin.java , https://github.com/marlester-dev/twilightforest-unofficial/blob/1.20.1-fabric/src/main/java/twilightforest/client/model/TFItemLayerModel.java , https://github.com/marlester-dev/twilightforest-unofficial/blob/1.20.1-fabric/src/main/java/twilightforest/data/ItemModelGenerator.java#L78
Log File
fixed on the mod's side by using
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/ItemRenderer;renderModelLists(Lnet/minecraft/client/resources/model/BakedModel;Lnet/minecraft/world/item/ItemStack;IILcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;)V"))
private void startRenderItem(ItemRenderer instance, BakedModel model, ItemStack stack, int combinedLight, int combinedOverlay, PoseStack matrixStack, VertexConsumer buffer, Operation<Void> original) {
if (stack.getItem() instanceof GiantItem) {
matrixStack.pushPose();
GiantItemRenderHelper.handle(matrixStack);
original.call(instance, model, stack, combinedLight, combinedOverlay, matrixStack, buffer);
matrixStack.popPose();
} else {
original.call(instance, model, stack, combinedLight, combinedOverlay, matrixStack, buffer);
}
}