Add hand to fish event for all player interactions

This commit is contained in:
booky10
2023-07-03 01:55:32 +02:00
parent cb16d3df2c
commit ffa5164e4c
2 changed files with 35 additions and 17 deletions

View File

@@ -12,6 +12,15 @@
public class FishingRodItem extends Item {
public FishingRodItem(Item.Properties settings) {
@@ -26,7 +31,7 @@
if (user.fishing != null) {
if (!world.isClientSide) {
- int i = user.fishing.retrieve(itemstack);
+ int i = user.fishing.retrieve(hand, itemstack); // Paper - Add hand parameter to PlayerFishEvent
itemstack.hurtAndBreak(i, user, LivingEntity.getSlotForHand(hand));
}
@@ -34,13 +39,24 @@
world.playSound((Player) null, user.getX(), user.getY(), user.getZ(), SoundEvents.FISHING_BOBBER_RETRIEVE, SoundSource.NEUTRAL, 1.0F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
user.gameEvent(GameEvent.ITEM_INTERACT_FINISH);