diff options
author | md_5 <git@md-5.net> | 2016-11-29 15:42:46 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-11-29 15:42:46 +1100 |
commit | 41ade2f291c4596ac489606ca2b730b72b460dc2 (patch) | |
tree | 915cbdb66c296fc816a9039dcb56a17cae7988be /nms-patches | |
parent | 1c07d5c78f07bf8a5dcc73c6f16f1b9743565b06 (diff) | |
download | craftbukkit-41ade2f291c4596ac489606ca2b730b72b460dc2.tar craftbukkit-41ade2f291c4596ac489606ca2b730b72b460dc2.tar.gz craftbukkit-41ade2f291c4596ac489606ca2b730b72b460dc2.tar.lz craftbukkit-41ade2f291c4596ac489606ca2b730b72b460dc2.tar.xz craftbukkit-41ade2f291c4596ac489606ca2b730b72b460dc2.zip |
SPIGOT-2860: Don't create 0 exp orbs when breeding
Diffstat (limited to 'nms-patches')
-rw-r--r-- | nms-patches/PathfinderGoalBreed.patch | 13 |
1 files 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 } } |