diff options
-rw-r--r-- | defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java | 5 |
1 files changed, 3 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 aa4df72..bd490d3 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 @@ -438,12 +438,13 @@ public class TypeItem extends CITType { } public BakedModel getItemModel(CITContext context, int seed) { + ClientWorld world = context.world instanceof ClientWorld clientWorld ? clientWorld : null; // get sub items or bakedModel if no sub item matches @Nullable - BakedModel bakedModel = bakedSubModels.apply(this.bakedModel, context.stack, (ClientWorld) context.world, context.entity, seed); + BakedModel bakedModel = bakedSubModels.apply(this.bakedModel, context.stack, world, context.entity, seed); // apply model overrides if (bakedModel != null && bakedModel.getOverrides() != null) - bakedModel = bakedModel.getOverrides().apply(bakedModel, context.stack, (ClientWorld) context.world, context.entity, seed); + bakedModel = bakedModel.getOverrides().apply(bakedModel, context.stack, world, context.entity, seed); return bakedModel; } |