Fix NPE in clipsAnything at world height
If the block is out of bounds, then the block state may be null.
This commit is contained in:
@@ -343,7 +343,7 @@ public abstract class EntityMixin implements CollisionEntity {
|
||||
final int newChunkX = fx >> 4;
|
||||
final int newChunkZ = fz >> 4;
|
||||
final LevelChunk chunk = lastChunkKey == (lastChunkKey = CoordinateUtils.getChunkKey(newChunkX, newChunkZ)) ?
|
||||
lastChunk : (lastChunk = (LevelChunk)chunkProvider.getChunk(fx >> 4, fz >> 4, ChunkStatus.FULL, true));
|
||||
lastChunk : (lastChunk = (LevelChunk)chunkProvider.getChunk(newChunkX, newChunkZ, ChunkStatus.FULL, true));
|
||||
tempPos.setX(fx);
|
||||
for (int fy = minY; fy <= maxY; ++fy) {
|
||||
tempPos.setY(fy);
|
||||
|
||||
@@ -245,7 +245,7 @@ public abstract class ExplosionMixin {
|
||||
}
|
||||
|
||||
final BlockState blockState = cachedBlock.blockState;
|
||||
if (!((CollisionBlockState)blockState).emptyCollisionShape()) {
|
||||
if (blockState != null && !((CollisionBlockState)blockState).emptyCollisionShape()) {
|
||||
VoxelShape collision = cachedBlock.cachedCollisionShape;
|
||||
if (collision == null) {
|
||||
collision = ((CollisionBlockState)blockState).getConstantCollisionShape();
|
||||
|
||||
Reference in New Issue
Block a user