Improve F3+T speed when in world

This commit is contained in:
embeddedt 2024-06-08 22:11:45 -04:00
parent 661c6c9ccf
commit 792f9790ea
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 2 additions and 2 deletions

View File

@ -297,7 +297,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(!(location instanceof ModelResourceLocation) || Minecraft.getInstance().level == null)
if(!(location instanceof ModelResourceLocation) || Minecraft.getInstance().getOverlay() != null)
return stateDefinition.getPossibleStates();
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
}

View File

@ -303,7 +303,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(!(location instanceof ModelResourceLocation) || Minecraft.getInstance().level == null)
if(!(location instanceof ModelResourceLocation) || Minecraft.getInstance().getOverlay() != null)
return stateDefinition.getPossibleStates();
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
}