mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-31 04:13:51 -07:00
Re-implement maxLeashDistance world conf and call missing event (#11301)
* Re-implement maxLeashDistance world config and call missing event * migrate config setting to double or default * fixes --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@@ -13,7 +13,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
- 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user