diff options
Diffstat (limited to 'patches/server/0479-Configurable-max-leash-distance.patch')
-rw-r--r-- | patches/server/0479-Configurable-max-leash-distance.patch | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/patches/server/0479-Configurable-max-leash-distance.patch b/patches/server/0479-Configurable-max-leash-distance.patch index 404169cae8..d2f544737b 100644 --- a/patches/server/0479-Configurable-max-leash-distance.patch +++ b/patches/server/0479-Configurable-max-leash-distance.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable max leash distance diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java -index 1f2d04a456c383815b0c5ef331471593556fd128..30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6 100644 +index 1f2d04a456c383815b0c5ef331471593556fd128..5c51dd5229689cba459655d488aee59bd159a414 100644 --- a/src/main/java/net/minecraft/world/entity/Leashable.java +++ b/src/main/java/net/minecraft/world/entity/Leashable.java @@ -179,7 +179,7 @@ public interface Leashable { @@ -13,7 +13,20 @@ index 1f2d04a456c383815b0c5ef331471593556fd128..30d7dd9646ba9d6a9396dc140a61eb2c } - if ((double) f > 10.0D) { -+ if ((double) f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance ++ if ((double) f > entity.level().paperConfig().misc.maxLeashDistance.or(LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance ((Leashable) entity).leashTooFarBehaviour(); } else if ((double) f > 6.0D) { ((Leashable) entity).elasticRangeLeashBehaviour(entity1, f); +diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java +index f2d311a5450eb684603580bbf7e9e7fc73fc2f5c..bf2c9134c7d9d5926add36b55e3cfea79e8c8243 100644 +--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java ++++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java +@@ -97,7 +97,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { + @Override + public boolean handleLeashAtDistance(Entity leashHolder, float distance) { + if (this.isInSittingPose()) { +- if (distance > 10.0F) { ++ if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance + this.dropLeash(true, true); + } + |