Skip to content

Commit c3e3dff

Browse files
committed
Return all possible states for model if given location is not an MRL
1 parent 5ec0708 commit c3e3dff

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
442442

443443
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
444444
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
445-
if(this.inTextureGatheringPass)
445+
if(this.inTextureGatheringPass || !(location instanceof ModelResourceLocation))
446446
return stateDefinition.getPossibleStates();
447447
else
448448
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ private <T extends Comparable<T>, V extends T> BlockState setPropertyGeneric(Blo
304304
}
305305
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
306306
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
307-
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
307+
if(!(location instanceof ModelResourceLocation))
308+
return stateDefinition.getPossibleStates();
309+
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
308310
}
309311

310312
@Override

0 commit comments

Comments
 (0)