mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 04:47:36 +01:00
Fix EntityUnleashEvent cancellation on distance cause (#11131)
This commit is contained in:
parent
3a47518b4b
commit
aa36ae6576
@ -41,7 +41,7 @@ index a46b7e09809937b6e09bc3e08760d34f6eb00c4d..e884f37137799c85e5acc410ae589636
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..674713a611e709542990f748027bdc5b800d6650 100644
|
||||
index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..bc03f1fe2a311bf61449879751360c6775dde6ac 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
@@ -166,8 +166,11 @@ public interface Leashable {
|
||||
@ -67,8 +67,8 @@ index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..674713a611e709542990f748027bdc5b
|
||||
- entity.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE));
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true);
|
||||
+ if (!event.callEvent()) return;
|
||||
+ dropLeash = event.isDropLeash();
|
||||
+ event.callEvent();
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
Loading…
Reference in New Issue
Block a user