Code cleanup

This commit is contained in:
LemADEC 2022-01-15 12:17:05 +01:00
parent d0a1f2c2c8
commit 087ba26932
5 changed files with 8 additions and 9 deletions

View file

@ -211,8 +211,7 @@ public abstract class BlockAbstractContainer extends BlockContainer implements I
}
@Override
public void breakBlock(final World world, @Nonnull final BlockPos blockPos, @Nonnull final IBlockState blockState) {
assert world != null;
public void breakBlock(@Nonnull final World world, @Nonnull final BlockPos blockPos, @Nonnull final IBlockState blockState) {
// cascade to tile entity before it's removed
final TileEntity tileEntity = world.getTileEntity(blockPos);
if (tileEntity instanceof TileEntityAbstractBase) {

View file

@ -73,7 +73,8 @@ public class CompatWarpDrive implements IBlockTransformer {
@Override
public void removeExternals(final World world, final int x, final int y, final int z,
final Block block, final int blockMeta, final TileEntity tileEntity) {
if (block instanceof BlockAirFlow || block instanceof BlockAirSource) {
if ( block instanceof BlockAirFlow
|| block instanceof BlockAirSource ) {
final ChunkData chunkData = ChunkHandler.getChunkData(world, x, y, z);
if (chunkData == null) {
// chunk isn't loaded, skip it

View file

@ -419,8 +419,7 @@ public class GlobalRegionManager {
}
public static void printRegistry(final String trigger) {
WarpDrive.logger.info(String.format("Global region registry (%s entries after %s):",
registry.size(), trigger));
WarpDrive.logger.info(String.format("Global region registry after %s:", trigger));
for (final Map.Entry<Integer, CopyOnWriteArraySet<GlobalRegion>> entryDimension : registry.entrySet()) {
final StringBuilder message = new StringBuilder();
@ -431,7 +430,7 @@ public class GlobalRegionManager {
registryItem.isolationRate));
}
WarpDrive.logger.info(String.format("- %d entries in dimension %d: %s",
entryDimension.getValue().size(), entryDimension.getKey(), message.toString()));
entryDimension.getValue().size(), entryDimension.getKey(), message ));
}
}

View file

@ -172,8 +172,8 @@ public class PlayerHandler {
final TileEntity tileEntity = entityPlayer.world.getTileEntity(globalRegion.getBlockPos());
if (!(tileEntity instanceof TileEntityShipCore)) {
if (Commons.throttleMe("onBreakSpeed-InvalidInstance")) {
WarpDrive.logger.error(String.format("Unable to adjust harvest speed due to invalid tile entity for global region, expecting TileEntityShipCore, got %s",
tileEntity ));
WarpDrive.logger.error(String.format("Unable to adjust harvest speed due to invalid tile entity for global region, expecting TileEntityShipCore, got %s %s. size is %d.",
tileEntity, Commons.format(entityPlayer.world, globalRegion.getBlockPos()), globalRegions.size() ));
}
return false;
}