Properly copy all stack attributes when consuming the bait from a fishing rod

This commit is contained in:
Sollace 2024-03-29 12:31:33 +00:00
parent e65838b943
commit f8ff162d6c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -30,7 +30,9 @@ public class BaitedFishingRodItem extends FishingRodItem {
if (result.getValue().isOf(this)) { if (result.getValue().isOf(this)) {
ItemStack stack = Items.FISHING_ROD.getDefaultStack(); ItemStack stack = Items.FISHING_ROD.getDefaultStack();
stack.setDamage(result.getValue().getDamage()); if (result.getValue().hasNbt()) {
stack.setNbt(result.getValue().getNbt().copy());
}
return TypedActionResult.success(stack, world.isClient()); return TypedActionResult.success(stack, world.isClient());
} }
} }