From fdef1ba84a7ce94047f5d3143187715f32ef3a80 Mon Sep 17 00:00:00 2001 From: mezz Date: Sat, 21 May 2016 17:52:28 -0700 Subject: [PATCH] Remove chunkExist functions from BlockUtil --- .../multiblock/MultiblockControllerBase.java | 3 +- .../java/forestry/core/utils/BlockUtil.java | 31 ------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java index d5c4e1ef2..e82adfa80 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java @@ -18,7 +18,6 @@ import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import forestry.api.multiblock.IMultiblockComponent; -import forestry.core.utils.BlockUtil; import forestry.core.utils.Log; import forestry.core.utils.Translator; @@ -425,7 +424,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI // If this returns true, the server has changed its internal data. // If our chunks are loaded (they should be), we must mark our chunks as dirty. if (minimumCoord != null && maximumCoord != null && - BlockUtil.checkChunksExist(worldObj, minimumCoord, maximumCoord)) { + worldObj.isAreaLoaded(minimumCoord, maximumCoord)) { int minChunkX = minimumCoord.getX() >> 4; int minChunkZ = minimumCoord.getZ() >> 4; int maxChunkX = maximumCoord.getX() >> 4; diff --git a/src/main/java/forestry/core/utils/BlockUtil.java b/src/main/java/forestry/core/utils/BlockUtil.java index e5f44d1fd..62146cfbc 100644 --- a/src/main/java/forestry/core/utils/BlockUtil.java +++ b/src/main/java/forestry/core/utils/BlockUtil.java @@ -238,37 +238,6 @@ public abstract class BlockUtil { /* CHUNKS */ - /** - * Checks if chunk exits. - */ - public static boolean checkChunksExist(World world, BlockPos minPos, BlockPos maxPos) { - return checkChunksExist(world, minPos.getX(), minPos.getY(), minPos.getZ(), maxPos.getX(), maxPos.getY(), maxPos.getZ()); - } - - /** - * Checks if chunk exits. - */ - public static boolean checkChunksExist(World world, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { - if (maxY >= 0 && minY < 256) { - minX >>= 4; - minZ >>= 4; - maxX >>= 4; - maxZ >>= 4; - - for (int k1 = minX; k1 <= maxX; ++k1) { - for (int l1 = minZ; l1 <= maxZ; ++l1) { - if (world.getChunkProvider().getLoadedChunk(k1, l1) == null) { - return false; - } - } - } - - return true; - } else { - return false; - } - } - public static boolean canReplace(IBlockState blockState, World world, BlockPos pos) { Block block = blockState.getBlock(); return block.isReplaceable(world, pos) && !block.getMaterial(blockState).isLiquid();