aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0470-Configurable-max-leash-distance.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0470-Configurable-max-leash-distance.patch')
-rw-r--r--patches/unapplied/server/0470-Configurable-max-leash-distance.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/unapplied/server/0470-Configurable-max-leash-distance.patch b/patches/unapplied/server/0470-Configurable-max-leash-distance.patch
new file mode 100644
index 0000000000..625e1c156b
--- /dev/null
+++ b/patches/unapplied/server/0470-Configurable-max-leash-distance.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 3 Jan 2021 21:04:03 -0800
+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 e53c3b53ea9c0932f0f049bf76f1f6de0432506a..dc39ecc3e1aada638337d31bfe68b400c6454af7 100644
+--- a/src/main/java/net/minecraft/world/entity/Leashable.java
++++ b/src/main/java/net/minecraft/world/entity/Leashable.java
+@@ -180,7 +180,7 @@ public interface Leashable {
+ return;
+ }
+
+- if ((double) f > 10.0D) {
++ 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 f239ab65d914ee9ec819e112f0a0466a06a77929..d2785628368b65854b6e1f35005c478d490a2f8c 100644
+--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
++++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+@@ -98,7 +98,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);
+ }
+