blockState
is null
if it can not be placed
This commit is contained in:
parent
7dfbe7bfaf
commit
a53114779a
1 changed files with 3 additions and 1 deletions
|
@ -34,7 +34,9 @@ public class BaseAnvilItem extends BlockItem implements ItemModelProvider {
|
|||
BlockState blockState = super.getPlacementState(blockPlaceContext);
|
||||
ItemStack stack = blockPlaceContext.getItemInHand();
|
||||
int destruction = stack.getOrCreateTag().getInt(DESTRUCTION);
|
||||
blockState = blockState.setValue(BaseAnvilBlock.DESTRUCTION, destruction);
|
||||
if (blockState != null) {
|
||||
blockState = blockState.setValue(BaseAnvilBlock.DESTRUCTION, destruction);
|
||||
}
|
||||
return blockState;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue