aboutsummaryrefslogtreecommitdiff
path: root/defaults/src/main/java/shcm/shsupercm
diff options
context:
space:
mode:
Diffstat (limited to 'defaults/src/main/java/shcm/shsupercm')
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java2
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/item/ModelLoaderMixin.java7
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;