summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalBreed.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/PathfinderGoalBreed.patch')
-rw-r--r--nms-patches/PathfinderGoalBreed.patch25
1 files changed, 23 insertions, 2 deletions
diff --git a/nms-patches/PathfinderGoalBreed.patch b/nms-patches/PathfinderGoalBreed.patch
index 3f74b1ac..e928ca43 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
-@@ -69,6 +69,11 @@
+@@ -69,11 +69,23 @@
EntityAgeable entityageable = this.animal.createChild(this.partner);
if (entityageable != null) {
@@ -12,7 +12,19 @@
EntityHuman entityhuman = this.animal.getBreedCause();
if (entityhuman == null && this.partner.getBreedCause() != null) {
-@@ -88,7 +93,7 @@
+ entityhuman = this.partner.getBreedCause();
+ }
++ // CraftBukkit start - call EntityBreedEvent
++ int experience = this.animal.getRandom().nextInt(7) + 1;
++ org.bukkit.event.entity.EntityBreedEvent entityBreedEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(entityageable, animal, partner, entityhuman, this.animal.breedItem, experience);
++ if (entityBreedEvent.isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+
+ if (entityhuman != null) {
+ entityhuman.b(StatisticList.C);
+@@ -88,7 +100,7 @@
this.partner.resetLove();
entityageable.setAgeRaw(-24000);
entityageable.setPositionRotation(this.animal.locX, this.animal.locY, this.animal.locZ, 0.0F, 0.0F);
@@ -21,3 +33,12 @@
Random random = this.animal.getRandom();
for (int i = 0; i < 7; ++i) {
+@@ -103,7 +115,7 @@
+ }
+
+ 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
+ }
+
+ }