Configurable max leash distance

This commit is contained in:
Jake Potrebic
2021-01-03 21:04:03 -08:00
parent 0faa210781
commit cd4969468c
2 changed files with 18 additions and 0 deletions

View File

@@ -12,6 +12,15 @@
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 @@
if (!this.canTeleportTo(new BlockPos(x, y, z))) {
return false;