Skip to content

Commit

Permalink
Fix server crash when igniting lightning bomb, Closes #1040
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 29, 2024
1 parent adf0763 commit ebceedb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public InteractionResult useWithoutItem(BlockState state, Level world, BlockPos
(player.getItemInHand(hand).getItem() == Items.FLINT_AND_STEEL || player.getItemInHand(hand).getItem() == Items.FIRE_CHARGE)) {
this.primeBomb(world, blockPos, defaultBlockState().setValue(PRIMED, true), player);
world.removeBlock(blockPos, false);
player.getItemInHand(hand).hurtAndBreak(1, (ServerLevel) world, player, (e) -> {});
if (world instanceof ServerLevel serverLevel) {
player.getItemInHand(hand).hurtAndBreak(1, serverLevel, player, (e) -> {});
}
return InteractionResult.SUCCESS;
} else {
return super.useWithoutItem(state, world, blockPos, player, p_225533_6_);
Expand Down

0 comments on commit ebceedb

Please sign in to comment.