geforkt von Mirrors/Paper
SPIGOT-2860: Don't create 0 exp orbs when breeding
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
5cdc0bbd0e
Commit
140a834de3
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/PathfinderGoalBreed.java
|
--- a/net/minecraft/server/PathfinderGoalBreed.java
|
||||||
+++ b/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);
|
EntityAgeable entityageable = this.animal.createChild(this.partner);
|
||||||
|
|
||||||
if (entityageable != null) {
|
if (entityageable != null) {
|
||||||
@ -20,11 +20,12 @@
|
|||||||
+ if (entityBreedEvent.isCancelled()) {
|
+ if (entityBreedEvent.isCancelled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
+ experience = entityBreedEvent.getExperience();
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
entityhuman.b(StatisticList.C);
|
entityhuman.b(StatisticList.C);
|
||||||
@@ -94,7 +106,7 @@
|
@@ -94,7 +107,7 @@
|
||||||
this.partner.resetLove();
|
this.partner.resetLove();
|
||||||
entityageable.setAgeRaw(-24000);
|
entityageable.setAgeRaw(-24000);
|
||||||
entityageable.setPositionRotation(this.animal.locX, this.animal.locY, this.animal.locZ, 0.0F, 0.0F);
|
entityageable.setPositionRotation(this.animal.locX, this.animal.locY, this.animal.locZ, 0.0F, 0.0F);
|
||||||
@ -33,12 +34,16 @@
|
|||||||
Random random = this.animal.getRandom();
|
Random random = this.animal.getRandom();
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < 7; ++i) {
|
||||||
@@ -109,7 +121,7 @@
|
@@ -109,7 +122,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a.getGameRules().getBoolean("doMobLoot")) {
|
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, 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
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren