mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
SPIGOT-1751: Add missed PlayerFishEvent for FAILED_ATTEMPT
By: md_5 <git@md-5.net>
This commit is contained in:
parent
3cb5dd22bb
commit
637b5fb592
@ -77,7 +77,7 @@
|
|||||||
double d0 = this.owner.locX - this.locX;
|
double d0 = this.owner.locX - this.locX;
|
||||||
double d1 = this.owner.locY - this.locY;
|
double d1 = this.owner.locY - this.locY;
|
||||||
double d2 = this.owner.locZ - this.locZ;
|
double d2 = this.owner.locZ - this.locZ;
|
||||||
@@ -410,13 +445,25 @@
|
@@ -410,15 +445,36 @@
|
||||||
entityitem.motY = d1 * d4 + (double) MathHelper.sqrt(d3) * 0.08D;
|
entityitem.motY = d1 * d4 + (double) MathHelper.sqrt(d3) * 0.08D;
|
||||||
entityitem.motZ = d2 * d4;
|
entityitem.motZ = d2 * d4;
|
||||||
this.world.addEntity(entityitem);
|
this.world.addEntity(entityitem);
|
||||||
@ -103,4 +103,15 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
i = 2;
|
i = 2;
|
||||||
}
|
}
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ if (i == 0) {
|
||||||
|
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
|
||||||
|
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
|
||||||
|
+ if (playerFishEvent.isCancelled()) {
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
|
||||||
|
this.die();
|
||||||
|
this.owner.hookedFish = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user