mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-01 21:03:52 -07:00
Configurable max leash distance
This commit is contained in:
@@ -85,6 +85,15 @@
|
|||||||
((Leashable) entity).dropLeash();
|
((Leashable) entity).dropLeash();
|
||||||
} else {
|
} else {
|
||||||
((Leashable) entity).removeLeash();
|
((Leashable) entity).removeLeash();
|
||||||
|
@@ -187,7 +201,7 @@
|
||||||
|
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);
|
||||||
@@ -205,13 +219,18 @@
|
@@ -205,13 +219,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,6 +12,15 @@
|
|||||||
|
|
||||||
public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
||||||
|
|
||||||
|
@@ -96,7 +101,7 @@
|
||||||
|
@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();
|
||||||
|
}
|
||||||
|
|
||||||
@@ -295,7 +300,14 @@
|
@@ -295,7 +300,14 @@
|
||||||
if (!this.canTeleportTo(new BlockPos(x, y, z))) {
|
if (!this.canTeleportTo(new BlockPos(x, y, z))) {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user