From 2bda2f19a107f5a31e62b7c60e95035fcea3448e Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Wed, 16 Feb 2022 14:23:32 +0200 Subject: Fixed minor bugs --- .../shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java | 2 ++ .../citresewn/defaults/mixin/types/item/ModelLoaderMixin.java | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java index b08f0c9..d9f9ba6 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java @@ -374,6 +374,8 @@ public class TypeItem extends CITType { } public Identifier fixDeprecatedSubItem(String subItem, PropertyGroup properties, int position) { + if (subItem == null) + return null; String replacement = switch (subItem) { case "bow_pulling_standby" -> "bow"; case "crossbow_standby" -> "crossbow"; diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java index c95e08a..adb4963 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java @@ -1,6 +1,7 @@ package shcm.shsupercm.fabric.citresewn.defaults.mixin.types.item; import com.mojang.datafixers.util.Either; +import net.minecraft.client.color.block.BlockColors; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.ModelLoader; import net.minecraft.client.render.model.SpriteAtlasManager; @@ -46,8 +47,10 @@ public class ModelLoaderMixin { @Shadow @Final private Map unbakedModels; @Shadow @Final private Map bakedModels; - @Inject(method = "addModel", at = @At("TAIL")) - public void citresewn$addTypeItemModels(ModelIdentifier eventModelId, CallbackInfo ci) { if (eventModelId != ModelLoader.MISSING_ID) return; + @Inject(method = "", at = + @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V")) + public void citresewn$addTypeItemModels(ResourceManager resourceManager, BlockColors blockColors, Profiler profiler, int i, CallbackInfo ci) { + profiler.swap("citresewn:type_item_models"); if (!ActiveCITs.isActive()) return; -- cgit