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
|
@Override
|
||||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||||
WorldView worldView = ctx.getWorld();
|
BlockState state = super.getPlacementState(ctx);
|
||||||
BlockPos blockPos = ctx.getBlockPos();
|
if (state != null) {
|
||||||
boolean water = worldView.getFluidState(blockPos).getFluid() == Fluids.WATER;
|
WorldView worldView = ctx.getWorld();
|
||||||
return super.getPlacementState(ctx).with(WATERLOGGED, water);
|
BlockPos blockPos = ctx.getBlockPos();
|
||||||
|
boolean water = worldView.getFluidState(blockPos).getFluid() == Fluids.WATER;
|
||||||
|
return state.with(WATERLOGGED, water);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue