Fix empty/null chunk section check in LevelChunk#getBlockData, rename… (#7039)
… patch and methods to make more sense with Mojang mappings
This commit is contained in:
@@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int k = Mth.floor(this.enderman.getZ() - 1.0D + random.nextDouble() * 2.0D);
|
||||
BlockPos blockposition = new BlockPos(i, j, k);
|
||||
- BlockState iblockdata = world.getBlockState(blockposition);
|
||||
+ BlockState iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
||||
+ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
|
||||
+ if (iblockdata == null) return; // Paper
|
||||
BlockPos blockposition1 = blockposition.below();
|
||||
BlockState iblockdata1 = world.getBlockState(blockposition1);
|
||||
@@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int k = Mth.floor(this.enderman.getZ() - 2.0D + random.nextDouble() * 4.0D);
|
||||
BlockPos blockposition = new BlockPos(i, j, k);
|
||||
- BlockState iblockdata = world.getBlockState(blockposition);
|
||||
+ BlockState iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
||||
+ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
|
||||
+ if (iblockdata == null) return; // Paper
|
||||
Vec3 vec3d = new Vec3((double) this.enderman.getBlockX() + 0.5D, (double) j + 0.5D, (double) this.enderman.getBlockZ() + 0.5D);
|
||||
Vec3 vec3d1 = new Vec3((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D);
|
||||
|
||||
Reference in New Issue
Block a user