Remove chunkExist functions from BlockUtil

This commit is contained in:
mezz committed 2016-05-21 17:52:28 -07:00
1 parent 292a0f029e
commit fdef1ba84a
2 files changed
+1 -33

No files matched your search

@@ -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;
@@ -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();