From 41ade2f291c4596ac489606ca2b730b72b460dc2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 29 Nov 2016 15:42:46 +1100 Subject: SPIGOT-2860: Don't create 0 exp orbs when breeding --- nms-patches/PathfinderGoalBreed.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nms-patches/PathfinderGoalBreed.patch b/nms-patches/PathfinderGoalBreed.patch index 4b9f88cf..1497ba99 100644 --- a/nms-patches/PathfinderGoalBreed.patch +++ b/nms-patches/PathfinderGoalBreed.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/PathfinderGoalBreed.java +++ b/net/minecraft/server/PathfinderGoalBreed.java -@@ -75,11 +75,23 @@ +@@ -75,11 +75,24 @@ EntityAgeable entityageable = this.animal.createChild(this.partner); if (entityageable != null) { @@ -20,11 +20,12 @@ + if (entityBreedEvent.isCancelled()) { + return; + } ++ experience = entityBreedEvent.getExperience(); + // CraftBukkit end if (entityhuman != null) { entityhuman.b(StatisticList.C); -@@ -94,7 +106,7 @@ +@@ -94,7 +107,7 @@ this.partner.resetLove(); entityageable.setAgeRaw(-24000); entityageable.setPositionRotation(this.animal.locX, this.animal.locY, this.animal.locZ, 0.0F, 0.0F); @@ -33,12 +34,16 @@ Random random = this.animal.getRandom(); for (int i = 0; i < 7; ++i) { -@@ -109,7 +121,7 @@ +@@ -109,7 +122,11 @@ } if (this.a.getGameRules().getBoolean("doMobLoot")) { - this.a.addEntity(new EntityExperienceOrb(this.a, this.animal.locX, this.animal.locY, this.animal.locZ, random.nextInt(7) + 1)); -+ this.a.addEntity(new EntityExperienceOrb(this.a, this.animal.locX, this.animal.locY, this.animal.locZ, entityBreedEvent.getExperience())); // CraftBukkit - use event experience ++ // CraftBukkit start - use event experience ++ if (experience > 0) { ++ this.a.addEntity(new EntityExperienceOrb(this.a, this.animal.locX, this.animal.locY, this.animal.locZ, experience)); ++ } ++ // CraftBukkit end } } -- cgit v1.2.3