aboutsummaryrefslogtreecommitdiff
path: root/defaults/src/main/java
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-03-08 15:59:52 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-03-08 15:59:52 +0200
commitea77714908943f4b7deed5b1a235e9bf17c80d7a (patch)
tree50d99eaf0936103e8b533b6670ef9d0ceca9d0ee /defaults/src/main/java
parent2356c6bb055079ef03cfd26e9d505ab9cea3960d (diff)
downloadCITResewn-ea77714908943f4b7deed5b1a235e9bf17c80d7a.tar.gz
CITResewn-ea77714908943f4b7deed5b1a235e9bf17c80d7a.tar.bz2
CITResewn-ea77714908943f4b7deed5b1a235e9bf17c80d7a.zip
Fixed context world not being a ClientWorld crash
Fixes #108
Diffstat (limited to 'defaults/src/main/java')
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java5
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;
}