Add a null check for RayTraceResult may fix #1393
This commit is contained in:
parent
52e1fb2dc9
commit
819e3a5ee1
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue