Return all possible states for model if given location is not an MRL

This commit is contained in:
embeddedt 2023-07-17 16:07:51 -04:00
parent 5ec070843d
commit c3e3dff805
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 4 additions and 2 deletions

View File

@ -442,7 +442,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
if(this.inTextureGatheringPass)
if(this.inTextureGatheringPass || !(location instanceof ModelResourceLocation))
return stateDefinition.getPossibleStates();
else
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);

View File

@ -304,7 +304,9 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
}
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
if(!(location instanceof ModelResourceLocation))
return stateDefinition.getPossibleStates();
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
}
@Override