Skip to content

Commit

Permalink
Fixed crash when throwing horseshoes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Oct 20, 2024
1 parent c5f33d0 commit 0603ebf
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,11 @@ protected void onBlockHit(BlockHitResult hit) {

if (!isBouncy()) {
if (stack.isIn(UTags.Items.HORSE_SHOES)) {
stack.damage(1 + random.nextInt(10), (ServerWorld)getWorld(), null, i -> {
playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1);
});
if (getWorld() instanceof ServerWorld sw) {
stack.damage(1 + random.nextInt(10), sw, null, i -> {
playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1);
});
}
if (stack.isEmpty()) {
discard();
return;
Expand Down

0 comments on commit 0603ebf

Please sign in to comment.