Prevent npe in one place.

This commit is contained in:
asofold 2012-11-29 15:57:57 +01:00
parent 37bca8836b
commit 68fbbcee1e

View File

@ -1208,6 +1208,7 @@ public class BlockProperties {
public static final boolean collidesBlock(final IBlockAccess access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int x, final int y, final int z, final int id){ public static final boolean collidesBlock(final IBlockAccess access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int x, final int y, final int z, final int id){
// TODO: use internal block data unless delegation wanted? // TODO: use internal block data unless delegation wanted?
final Block block = Block.byId[id]; final Block block = Block.byId[id];
if (block == null) return false; // TODO: policy ?
block.updateShape(access, x, y, z); block.updateShape(access, x, y, z);
final long flags = blockFlags[id]; final long flags = blockFlags[id];
final double bminX, bminZ, bminY; final double bminX, bminZ, bminY;