diff options
Diffstat (limited to 'nms-patches/EntityFishingHook.patch')
-rw-r--r-- | nms-patches/EntityFishingHook.patch | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch index e993146c..043d78d7 100644 --- a/nms-patches/EntityFishingHook.patch +++ b/nms-patches/EntityFishingHook.patch @@ -22,9 +22,9 @@ this.hooked = movingobjectposition.entity; this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1)); @@ -266,6 +273,10 @@ - if (this.av <= 0) { + if (this.au <= 0) { + this.av = 0; this.aw = 0; - this.ax = 0; + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT); + this.world.getServer().getPluginManager().callEvent(playerFishEvent); @@ -33,9 +33,9 @@ } else { double d10; @@ -278,6 +289,13 @@ - if (this.ax > 0) { - this.ax -= l; - if (this.ax <= 0) { + if (this.aw > 0) { + this.aw -= l; + if (this.aw <= 0) { + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.BITE); + this.world.getServer().getPluginManager().callEvent(playerFishEvent); @@ -46,7 +46,7 @@ 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); -@@ -388,6 +406,14 @@ +@@ -390,6 +408,14 @@ int i = 0; if (this.hooked != null) { @@ -61,7 +61,7 @@ this.k(); this.world.broadcastEntityEffect(this, (byte) 31); i = this.hooked instanceof EntityItem ? 3 : 5; -@@ -400,6 +426,15 @@ +@@ -402,6 +428,15 @@ while (iterator.hasNext()) { ItemStack itemstack = (ItemStack) iterator.next(); EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); @@ -77,9 +77,9 @@ double d0 = this.owner.locX - this.locX; double d1 = this.owner.locY - this.locY; double d2 = this.owner.locZ - this.locZ; -@@ -410,15 +445,36 @@ - entityitem.motY = d1 * d4 + (double) MathHelper.sqrt(d3) * 0.08D; - entityitem.motZ = d2 * d4; +@@ -412,15 +447,36 @@ + entityitem.motY = d1 * 0.1D + (double) MathHelper.sqrt(d3) * 0.08D; + entityitem.motZ = d2 * 0.1D; this.world.addEntity(entityitem); - this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, this.random.nextInt(6) + 1)); + // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() |