Call EntityDropItemEvent for goats dropping horns (#8094)

This commit is contained in:
Bjarne Koll 2022-07-04 21:26:43 +02:00 committed by GitHub
parent fbb11db9a5
commit c879064bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -57,3 +57,17 @@ index 8f294f10aca2df007830b12da0506f7614206a89..6a66b5d1a3d8615dcc15057f03476e9c
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index 56dd01801f56c56d07101e7e22b58ac059f5f07f..31be36e6b7b6bd0c0d7fda4e1b03ecd38947f3a5 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -329,8 +329,7 @@ public class Goat extends Animal {
double d2 = (double) Mth.randomBetween(this.random, -0.2F, 0.2F);
ItemEntity entityitem = new ItemEntity(this.level, vec3d.x(), vec3d.y(), vec3d.z(), itemstack, d0, d1, d2);
- this.level.addFreshEntity(entityitem);
- return true;
+ return this.spawnAtLocation(entityitem) != null; // Paper - call EntityDropItemEvent by calling spawnAtLocation.
}
}