Add a null check for RayTraceResult may fix #1393

This commit is contained in:
modmuss50 2018-01-12 19:48:41 +00:00
parent 52e1fb2dc9
commit 819e3a5ee1
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -87,7 +87,7 @@ public class DynamicCell extends Item {
if (!worldIn.isRemote) { if (!worldIn.isRemote) {
RayTraceResult result = rayTrace(worldIn, playerIn, true); RayTraceResult result = rayTrace(worldIn, playerIn, true);
if (result.typeOfHit == RayTraceResult.Type.BLOCK) { if (result != null && result.typeOfHit == RayTraceResult.Type.BLOCK) {
BlockPos pos = result.getBlockPos(); BlockPos pos = result.getBlockPos();
IBlockState state = worldIn.getBlockState(pos); IBlockState state = worldIn.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();