Skip to content

Commit e6bf43f

Browse files
committed
fix nullref on wrenching
1 parent fe3821f commit e6bf43f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/main/java/net/quarrymod/block/QuarryBlock.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity p
4444
@Override
4545
public void onStateReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
4646
if (state.getBlock() != newState.getBlock()) {
47-
ItemHandlerUtils.dropItemHandler(worldIn, pos, ((QuarryBlockEntity) worldIn.getBlockEntity(pos)).quarryUpgradesInventory);
47+
QuarryBlockEntity quarryBlockEntity = ((QuarryBlockEntity) worldIn.getBlockEntity(pos));
48+
if (quarryBlockEntity != null)
49+
ItemHandlerUtils.dropItemHandler(worldIn, pos, quarryBlockEntity.quarryUpgradesInventory);
4850
super.onStateReplaced(state, worldIn, pos, newState, isMoving);
4951
}
5052
}

0 commit comments

Comments
 (0)