diff options
author | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
commit | c25ddf063a808e3adb749e22017661f403c5fb7e (patch) | |
tree | b2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/ItemFishingRod.patch | |
parent | 51263e97187a84338f89698eef187284055a682a (diff) | |
download | craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip |
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/ItemFishingRod.patch')
-rw-r--r-- | nms-patches/ItemFishingRod.patch | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nms-patches/ItemFishingRod.patch b/nms-patches/ItemFishingRod.patch index b3efc66c..0c8cee22 100644 --- a/nms-patches/ItemFishingRod.patch +++ b/nms-patches/ItemFishingRod.patch @@ -8,23 +8,23 @@ public class ItemFishingRod extends Item { public ItemFishingRod() { -@@ -17,9 +19,18 @@ +@@ -19,9 +21,18 @@ itemstack.damage(i, entityhuman); entityhuman.a(enumhand); } else { -+ // CraftBukkit start -+ EntityFishingHook hook = new EntityFishingHook(world, entityhuman); -+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.Fish) hook.getBukkitEntity(), PlayerFishEvent.State.FISHING); -+ world.getServer().getPluginManager().callEvent(playerFishEvent); -+ -+ if (playerFishEvent.isCancelled()) { -+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); -+ } -+ // CraftBukkit end - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.H, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.j.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.I, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.j.nextFloat() * 0.4F + 0.8F)); if (!world.isClientSide) { -- world.addEntity(new EntityFishingHook(world, entityhuman)); -+ world.addEntity(hook); // CraftBukkit - moved creation up - } ++ // CraftBukkit start + EntityFishingHook entityfishinghook = new EntityFishingHook(world, entityhuman); ++ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.Fish) entityfishinghook.getBukkitEntity(), PlayerFishEvent.State.FISHING); ++ world.getServer().getPluginManager().callEvent(playerFishEvent); ++ ++ if (playerFishEvent.isCancelled()) { ++ entityhuman.hookedFish = null; ++ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); ++ } ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.I, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.j.nextFloat() * 0.4F + 0.8F)); ++ // CraftBukkit end - entityhuman.a(enumhand); + world.addEntity(entityfishinghook); + } |