FiniteReality / embeddium

An open-source client performance mod for Minecraft (based on Sodium 0.5.8) prioritizing reliability & mod compatibility
https://legacy.curseforge.com/minecraft/mc-mods/embeddium
GNU Lesser General Public License v3.0
209 stars 87 forks source link

Rendering giant tools in hand and in inventory issue - Twilight Forest Unofficial (Fabric 1.20.1) #412

Open marlester-dev opened 1 week ago

marlester-dev commented 1 week ago

Bug Description

Without Embeddium (normal): without without2 With Embeddium: with with2

Reproduction Steps

  1. Install Fabric API, The Twilight Forest Unofficial and Embeddium
  2. Log in and take the giant items out of the creative inventory
  3. 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

https://pastebin.com/MVqK1PG5

marlester-dev commented 1 week ago

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);
        }
    }
marlester-dev commented 1 week ago

you may close this issue if you want