SPIGOT-1931: Call PlayerFishEvent before modifying hooked entities velocity

This commit is contained in:
Matthew 2016-03-15 09:26:45 -04:00 committed by md_5
parent 00d333414a
commit 45adbd9c6f

View File

@ -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();