aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0477-Expand-EntityUnleashEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0477-Expand-EntityUnleashEvent.patch')
-rw-r--r--patches/server/0477-Expand-EntityUnleashEvent.patch5
1 files changed, 3 insertions, 2 deletions
diff --git a/patches/server/0477-Expand-EntityUnleashEvent.patch b/patches/server/0477-Expand-EntityUnleashEvent.patch
index 8d23e8ce85..09c4e7f7eb 100644
--- a/patches/server/0477-Expand-EntityUnleashEvent.patch
+++ b/patches/server/0477-Expand-EntityUnleashEvent.patch
@@ -43,7 +43,7 @@ index 07aff05e2e8cd36ebb6b9fb9d2f19b95c5f9bfc4..bb2cfec32b63d3786f9ec255d4beef70
}
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
-index dc39ecc3e1aada638337d31bfe68b400c6454af7..1a6448cccf79a94013f9f44c3067d91da3da1f7e 100644
+index dc39ecc3e1aada638337d31bfe68b400c6454af7..b7721ed97305d1cd6725935f965c2effc1bef5a1 100644
--- a/src/main/java/net/minecraft/world/entity/Leashable.java
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java
@@ -167,8 +167,11 @@ public interface Leashable {
@@ -51,10 +51,11 @@ index dc39ecc3e1aada638337d31bfe68b400c6454af7..1a6448cccf79a94013f9f44c3067d91d
if (leashable_a != null && leashable_a.leashHolder != null) {
if (!entity.isAlive() || !leashable_a.leashHolder.isAlive()) {
- world.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
+- Leashable.dropLeash(entity, true, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+ // Paper start - Expand EntityUnleashEvent
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved);
+ event.callEvent();
- Leashable.dropLeash(entity, true, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
++ Leashable.dropLeash(entity, true, event.isDropLeash()); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+ // Paper end - Expand EntityUnleashEvent
}