Add isDebugEnabled check to not evaluate toShortString
Slightly more performant if debug logging not enabled. Could also use a Supplier taking overload of the .debug method, but that incurs additional lambda object creation that would most likely neglect any performance gains from not evaluating the toShortString method.
This commit is contained in:
parent
ea9c7469bc
commit
29fc4b3ac8
|
|
@ -87,7 +87,9 @@ public abstract class LevelChunkMixin extends ChunkAccess {
|
|||
BlockEntity blockEntity = this.getBlockEntity(pos.immutable(), LevelChunk.EntityCreationType.IMMEDIATE);
|
||||
String blockName = state.getBlock().toString();
|
||||
if (blockEntity != null) {
|
||||
ModernFix.LOGGER.debug("Created missing block entity for {} at {}", blockName, pos.toShortString());
|
||||
if (ModernFix.LOGGER.isDebugEnabled()) {
|
||||
ModernFix.LOGGER.debug("Created missing block entity for {} at {}", blockName, pos.toShortString());
|
||||
}
|
||||
} else {
|
||||
ModernFix.LOGGER.error("Block entity is missing for {} at {}, but could not be created", blockName, pos.toShortString());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user