aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java b/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java
index 61fc82e..e7207f4 100644
--- a/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java
+++ b/src/main/java/moe/nea/firmament/mixins/CustomModelEventPatch.java
@@ -7,6 +7,7 @@ import net.minecraft.client.render.item.ItemModels;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.BakedModelManager;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -14,16 +15,15 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+import java.util.Map;
+
@Mixin(ItemModels.class)
public class CustomModelEventPatch {
- @Shadow
- @Final
- private BakedModelManager modelManager;
- @Inject(method = "getModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/render/model/BakedModel;", at = @At("HEAD"), cancellable = true)
- public void onGetModel(ItemStack stack, CallbackInfoReturnable<BakedModel> cir) {
- var model = CustomItemModelEvent.getModel(stack, modelManager);
- if (model != null)
- cir.setReturnValue(model);
- }
+ @Inject(method = "getModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/render/model/BakedModel;", at = @At("HEAD"), cancellable = true)
+ public void onGetModel(ItemStack stack, CallbackInfoReturnable<BakedModel> cir) {
+ var model = CustomItemModelEvent.getModel(stack, (ItemModels) (Object) this);
+ if (model != null)
+ cir.setReturnValue(model);
+ }
}