summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemFishingRod.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/ItemFishingRod.patch')
-rw-r--r--nms-patches/ItemFishingRod.patch10
1 files changed, 5 insertions, 5 deletions
diff --git a/nms-patches/ItemFishingRod.patch b/nms-patches/ItemFishingRod.patch
index 90910268..06921408 100644
--- a/nms-patches/ItemFishingRod.patch
+++ b/nms-patches/ItemFishingRod.patch
@@ -8,9 +8,9 @@
public class ItemFishingRod extends Item {
public ItemFishingRod() {
-@@ -15,9 +17,18 @@
+@@ -17,9 +19,18 @@
itemstack.damage(i, entityhuman);
- entityhuman.bw();
+ entityhuman.a(enumhand);
} else {
+ // CraftBukkit start
+ EntityFishingHook hook = new EntityFishingHook(world, entityhuman);
@@ -18,13 +18,13 @@
+ world.getServer().getPluginManager().callEvent(playerFishEvent);
+
+ if (playerFishEvent.isCancelled()) {
-+ return itemstack;
++ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
+ }
+ // CraftBukkit end
- world.makeSound(entityhuman, "random.bow", 0.5F, 0.4F / (ItemFishingRod.g.nextFloat() * 0.4F + 0.8F));
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.H, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.i.nextFloat() * 0.4F + 0.8F));
if (!world.isClientSide) {
- world.addEntity(new EntityFishingHook(world, entityhuman));
+ world.addEntity(hook); // CraftBukkit - moved creation up
}
- entityhuman.bw();
+ entityhuman.a(enumhand);