From c2044ab901f80f3126d0dd114bdbcfba753ffa24 Mon Sep 17 00:00:00 2001 From: lowercasebtw <126462578+lowercasebtw@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:17:20 -0400 Subject: [PATCH] Use new method for getting missing model (#596) --- .../mixin/fixes/minecraft/item/MixinItemRenderer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java index 252956536..1f37831ca 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java @@ -23,6 +23,7 @@ import net.minecraft.client.render.item.ItemModels; import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.BakedModelManager; import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -39,12 +40,12 @@ public abstract class MixinItemRenderer { @Shadow @Final - private ItemModels models; + private BakedModelManager bakedModelManager; @Inject(method = "getModel(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)Lnet/minecraft/client/render/model/BakedModel;", at = @At("HEAD"), cancellable = true) private void removeModel(ItemStack stack, World world, LivingEntity entity, int seed, CallbackInfoReturnable cir) { if (VisualSettings.global().replacePetrifiedOakSlab.isEnabled() && world != null /* world is null in gui rendering */ && stack.isOf(Items.PETRIFIED_OAK_SLAB)) { - cir.setReturnValue(this.models.getModel(ItemStack.EMPTY)); + cir.setReturnValue(this.bakedModelManager.getMissingModel()); } }