Skip to content

Commit 9df79d8

Browse files
committed
Skip filtering states when not in a world
1 parent 1572bd7 commit 9df79d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/BlockStateModelLoaderMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public void loadSpecificBlock(ModelResourceLocation location) {
5252
var optionalBlock = BuiltInRegistries.BLOCK.getOptional(location.id());
5353
if(optionalBlock.isPresent()) {
5454
try {
55-
// Only filter states if we are not in the loading overlay
56-
filteredStates = Minecraft.getInstance().getOverlay() == null ? ModelBakeryHelpers.getBlockStatesForMRL(optionalBlock.get().getStateDefinition(), location) : null;
55+
// Only filter states if we are in a world and not in the loading overlay
56+
filteredStates = (Minecraft.getInstance().getOverlay() == null && Minecraft.getInstance().level != null) ? ModelBakeryHelpers.getBlockStatesForMRL(optionalBlock.get().getStateDefinition(), location) : null;
5757
} catch(RuntimeException e) {
5858
ModernFix.LOGGER.error("Exception filtering states on {}", location, e);
5959
filteredStates = null;

0 commit comments

Comments
 (0)