mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
SPIGOT-1931: Call PlayerFishEvent before modifying hooked entities velocity
This commit is contained in:
parent
00d333414a
commit
45adbd9c6f
@ -46,10 +46,10 @@
|
|||||||
this.motY -= 0.20000000298023224D;
|
this.motY -= 0.20000000298023224D;
|
||||||
this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||||
f2 = (float) MathHelper.floor(this.getBoundingBox().b);
|
f2 = (float) MathHelper.floor(this.getBoundingBox().b);
|
||||||
@@ -391,6 +409,14 @@
|
@@ -388,6 +406,14 @@
|
||||||
this.k();
|
int i = 0;
|
||||||
this.world.broadcastEntityEffect(this, (byte) 31);
|
|
||||||
i = this.hooked instanceof EntityItem ? 3 : 5;
|
if (this.hooked != null) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), (Fish) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY);
|
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), (Fish) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY);
|
||||||
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
|
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
|
||||||
@ -58,9 +58,9 @@
|
|||||||
+ return 0;
|
+ return 0;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
} else if (this.au > 0) {
|
this.k();
|
||||||
LootTableInfo.a loottableinfo_a = new LootTableInfo.a((WorldServer) this.world);
|
this.world.broadcastEntityEffect(this, (byte) 31);
|
||||||
|
i = this.hooked instanceof EntityItem ? 3 : 5;
|
||||||
@@ -400,6 +426,15 @@
|
@@ -400,6 +426,15 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ItemStack itemstack = (ItemStack) iterator.next();
|
ItemStack itemstack = (ItemStack) iterator.next();
|
||||||
|
Loading…
Reference in New Issue
Block a user