Skip filtering states when not in a world
This commit is contained in:
parent
1572bd705d
commit
9df79d8c8c
|
|
@ -52,8 +52,8 @@ public abstract class BlockStateModelLoaderMixin implements IBlockStateModelLoad
|
||||||
var optionalBlock = BuiltInRegistries.BLOCK.getOptional(location.id());
|
var optionalBlock = BuiltInRegistries.BLOCK.getOptional(location.id());
|
||||||
if(optionalBlock.isPresent()) {
|
if(optionalBlock.isPresent()) {
|
||||||
try {
|
try {
|
||||||
// Only filter states if we are not in the loading overlay
|
// Only filter states if we are in a world and not in the loading overlay
|
||||||
filteredStates = Minecraft.getInstance().getOverlay() == null ? ModelBakeryHelpers.getBlockStatesForMRL(optionalBlock.get().getStateDefinition(), location) : null;
|
filteredStates = (Minecraft.getInstance().getOverlay() == null && Minecraft.getInstance().level != null) ? ModelBakeryHelpers.getBlockStatesForMRL(optionalBlock.get().getStateDefinition(), location) : null;
|
||||||
} catch(RuntimeException e) {
|
} catch(RuntimeException e) {
|
||||||
ModernFix.LOGGER.error("Exception filtering states on {}", location, e);
|
ModernFix.LOGGER.error("Exception filtering states on {}", location, e);
|
||||||
filteredStates = null;
|
filteredStates = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user