Added ignored Try-Catch "//to fix ghost chunks get loaded and generating NullPointerExceptions"

This commit is contained in:
matteo francesconi 2020-04-21 21:31:14 +02:00
parent c9b9a9aa30
commit ac7bbc16a1
1 changed files with 9 additions and 7 deletions

View File

@ -245,14 +245,16 @@ public class Search extends Module {
BlockPos pos2 = new BlockPos(chunk.getPos().getXEnd(), 256, chunk.getPos().getZEnd());
Iterable<BlockPos> blocks = BlockPos.getAllInBox(pos1, pos2);
Map<BlockPos, Tuple<Integer, Integer>> foundBlocks = new HashMap<>();
for (BlockPos blockPos : blocks) {
int side = GeometryMasks.Quad.ALL;
Block block = mc.world.getBlockState(blockPos).getBlock();
if (blocksToFind.contains(block)) {
Tuple<Integer, Integer> tuple = getTuple(side, block);
foundBlocks.put(blockPos, tuple);
try {
for (BlockPos blockPos : blocks) {
int side = GeometryMasks.Quad.ALL;
Block block = mc.world.getBlockState(blockPos).getBlock();
if (blocksToFind.contains(block)) {
Tuple<Integer, Integer> tuple = getTuple(side, block);
foundBlocks.put(blockPos, tuple);
}
}
}
}catch (NullPointerException ignored){} //to fix ghost chunks get loaded and generating NullPointerExceptions
return foundBlocks;
}