Skip to content

Commit 7fbfcf1

Browse files
committed
Remove error when missing_block_entities sees null BE
Blocks may legitimately not have a block entity for some states
1 parent 1bcb28a commit 7fbfcf1

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/missing_block_entities

src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/missing_block_entities/LevelChunkMixin.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ private void makeBlockEntityIfNotExists(BlockState state, BlockPos.MutableBlockP
8686
}
8787

8888
BlockEntity blockEntity = this.getBlockEntity(pos.immutable(), LevelChunk.EntityCreationType.IMMEDIATE);
89-
String blockName = state.getBlock().toString();
90-
if (blockEntity != null) {
91-
if (ModernFix.LOGGER.isDebugEnabled()) {
92-
ModernFix.LOGGER.debug("Created missing block entity for {} at {}", blockName, pos.toShortString());
93-
}
94-
} else {
95-
ModernFix.LOGGER.error("Block entity is missing for {} at {}, but could not be created", blockName, pos.toShortString());
89+
if (blockEntity != null && ModernFix.LOGGER.isDebugEnabled()) {
90+
String blockName = state.getBlock().toString();
91+
ModernFix.LOGGER.debug("Created missing block entity for {} at {}", blockName, pos.toShortString());
9692
}
9793
}
9894
}

0 commit comments

Comments
 (0)