diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-02-16 14:23:32 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-02-16 14:23:32 +0200 |
commit | 2bda2f19a107f5a31e62b7c60e95035fcea3448e (patch) | |
tree | 39fd869860921e1a58631a352281510a1b888c99 /defaults/src/main/java | |
parent | 55e32286cb149e4c20aa8466d51b4d40dae58d48 (diff) | |
download | CITResewn-2bda2f19a107f5a31e62b7c60e95035fcea3448e.tar.gz CITResewn-2bda2f19a107f5a31e62b7c60e95035fcea3448e.tar.bz2 CITResewn-2bda2f19a107f5a31e62b7c60e95035fcea3448e.zip |
Fixed minor bugs
Diffstat (limited to 'defaults/src/main/java')
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<Identifier, UnbakedModel> unbakedModels; @Shadow @Final private Map<Identifier, BakedModel> bakedModels; - @Inject(method = "addModel", at = @At("TAIL")) - public void citresewn$addTypeItemModels(ModelIdentifier eventModelId, CallbackInfo ci) { if (eventModelId != ModelLoader.MISSING_ID) return; + @Inject(method = "<init>", 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; |