Null pointer fix
This commit is contained in:
parent
f06d270b01
commit
42dfb9325b
1 changed files with 8 additions and 4 deletions
|
@ -82,10 +82,14 @@ public class BlockSulphurCrystal extends BlockAttached implements IRenderTypeabl
|
|||
|
||||
@Override
|
||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||
BlockState state = super.getPlacementState(ctx);
|
||||
if (state != null) {
|
||||
WorldView worldView = ctx.getWorld();
|
||||
BlockPos blockPos = ctx.getBlockPos();
|
||||
boolean water = worldView.getFluidState(blockPos).getFluid() == Fluids.WATER;
|
||||
return super.getPlacementState(ctx).with(WATERLOGGED, water);
|
||||
return state.with(WATERLOGGED, water);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue