summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorMatthew <stteg@hotmail.com>2016-03-15 09:26:45 -0400
committermd_5 <git@md-5.net>2016-03-16 07:11:44 +1100
commit45adbd9c6f4fd2fb2d971192904be21f01a70097 (patch)
treeb058ba4f1d41aef6d0093e6cbe01989f098dd0a5 /nms-patches
parent00d333414afbff4f646867631970c52065e161cb (diff)
downloadcraftbukkit-45adbd9c6f4fd2fb2d971192904be21f01a70097.tar
craftbukkit-45adbd9c6f4fd2fb2d971192904be21f01a70097.tar.gz
craftbukkit-45adbd9c6f4fd2fb2d971192904be21f01a70097.tar.lz
craftbukkit-45adbd9c6f4fd2fb2d971192904be21f01a70097.tar.xz
craftbukkit-45adbd9c6f4fd2fb2d971192904be21f01a70097.zip
SPIGOT-1931: Call PlayerFishEvent before modifying hooked entities velocity
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityFishingHook.patch14
1 files changed, 7 insertions, 7 deletions
diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch
index 855c7e6f..4fabdd73 100644
--- a/nms-patches/EntityFishingHook.patch
+++ b/nms-patches/EntityFishingHook.patch
@@ -46,10 +46,10 @@
this.motY -= 0.20000000298023224D;
this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
f2 = (float) MathHelper.floor(this.getBoundingBox().b);
-@@ -391,6 +409,14 @@
- this.k();
- this.world.broadcastEntityEffect(this, (byte) 31);
- i = this.hooked instanceof EntityItem ? 3 : 5;
+@@ -388,6 +406,14 @@
+ int i = 0;
+
+ if (this.hooked != null) {
+ // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), (Fish) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
@@ -58,9 +58,9 @@
+ return 0;
+ }
+ // CraftBukkit end
- } else if (this.au > 0) {
- LootTableInfo.a loottableinfo_a = new LootTableInfo.a((WorldServer) this.world);
-
+ this.k();
+ this.world.broadcastEntityEffect(this, (byte) 31);
+ i = this.hooked instanceof EntityItem ? 3 : 5;
@@ -400,6 +426,15 @@
while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();