From c879064bfeaac42e1baed0e48973664a8ad75f37 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Mon, 4 Jul 2022 21:26:43 +0200 Subject: [PATCH] Call EntityDropItemEvent for goats dropping horns (#8094) --- ...various-missing-EntityDropItemEvent-calls.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/patches/server/0922-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0922-Add-various-missing-EntityDropItemEvent-calls.patch index 840fad7af7..f47913c824 100644 --- a/patches/server/0922-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0922-Add-various-missing-EntityDropItemEvent-calls.patch @@ -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. + } + } +