mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 26dfbc80 Updated Upstream (Bukkit/CraftBukkit) 539543ca MC-145656 Fix Follow Range Initial Target (#2778)
This commit is contained in:
2
Paper
2
Paper
Submodule Paper updated: dfd740cd7c...26dfbc8046
@@ -1 +1 @@
|
|||||||
1.15.1--67f83a3fdd20c9b5b83eed023fe29d97d39ed70c
|
1.15.1--b27330331352957a9a859154216a981efdb28bb8
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
From 016816c1b8fe5ff026a6d429c6fb5b47f4c6c82a Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Wed, 18 Dec 2019 19:54:13 -0600
|
|
||||||
Subject: [PATCH] MC-145656 Fix Follow Range Initial Target
|
|
||||||
|
|
||||||
---
|
|
||||||
.../PathfinderGoalNearestAttackableTarget.java | 1 +
|
|
||||||
.../server/PathfinderTargetCondition.java | 16 +++++++++++++++-
|
|
||||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
|
||||||
3 files changed, 21 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
||||||
index 5a2fa079e..2bbc0dfcf 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
||||||
@@ -25,6 +25,7 @@ public class PathfinderGoalNearestAttackableTarget<T extends EntityLiving> exten
|
|
||||||
this.b = i;
|
|
||||||
this.a(EnumSet.of(PathfinderGoal.Type.TARGET));
|
|
||||||
this.d = (new PathfinderTargetCondition()).a(this.k()).a(predicate);
|
|
||||||
+ if (entityinsentient.world.purpurConfig.entitiesTargetWithFollowRange) this.d.useFollowRange(); // Purpur
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java
|
|
||||||
index c76a43837..0fa652124 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java
|
|
||||||
@@ -80,7 +80,7 @@ public class PathfinderTargetCondition {
|
|
||||||
|
|
||||||
if (this.b > 0.0D) {
|
|
||||||
double d0 = this.g ? entityliving1.A(entityliving) : 1.0D;
|
|
||||||
- double d1 = this.b * d0;
|
|
||||||
+ double d1 = (useFollowRange ? getFollowRange(entityliving) : this.b) * d0; // Purpur
|
|
||||||
double d2 = entityliving.g(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ());
|
|
||||||
|
|
||||||
if (d2 > d1 * d1) {
|
|
||||||
@@ -96,4 +96,18 @@ public class PathfinderTargetCondition {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Purpur start
|
|
||||||
+ private boolean useFollowRange = false;
|
|
||||||
+
|
|
||||||
+ public PathfinderTargetCondition useFollowRange() {
|
|
||||||
+ this.useFollowRange = true;
|
|
||||||
+ return this;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private double getFollowRange(EntityLiving entityliving) {
|
|
||||||
+ AttributeInstance attributeinstance = entityliving.getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
|
|
||||||
+ return attributeinstance == null ? 16.0D : attributeinstance.getValue();
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index f61ed338c..f98f7b2cb 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -195,4 +195,9 @@ public class PurpurWorldConfig {
|
|
||||||
elytraDamagePerFireworkBoost = getInt("elytra.damage-per-boost.firework", elytraDamagePerFireworkBoost);
|
|
||||||
elytraDamagePerTridentBoost = getInt("elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public boolean entitiesTargetWithFollowRange = false;
|
|
||||||
+ private void entitiesTargetWithFollowRange() {
|
|
||||||
+ entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.24.0.rc1
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user