mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
temp disable async-target-finding
This commit is contained in:
@@ -48,7 +48,7 @@ index 33dd16a26edd2974f04d9a868d3e58e8e3060032..eb0589b203bcf72cd24bb37f2c448c23
|
||||
|
||||
// Gale start - Pufferfish - SIMD support
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 90bdcd168ad5b1a940f81b191bd59a34d3a33070..fbfb35dad8b07c31f967d33fb04cfcfc94557d72 100644
|
||||
index 9af7dafe03812d96aa477584d4147a68c240ab21..539206d55e87ec9968664305caaf475c991fe4d5 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -177,7 +177,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -135,60 +135,6 @@ index 90bdcd168ad5b1a940f81b191bd59a34d3a33070..fbfb35dad8b07c31f967d33fb04cfcfc
|
||||
}
|
||||
|
||||
// Paper start - log detailed entity tick information
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 0903508d2cd3c78602e62dbcff4aa70285bc4c4f..e99fd55a90c68cc96701e5291219d1d056ed266b 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -243,6 +243,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
protected Vec3 stuckSpeedMultiplier = Vec3.ZERO;
|
||||
@Nullable
|
||||
private Entity.RemovalReason removalReason;
|
||||
+ private volatile boolean isRemoved = false; // Leaf - Async target finding - volatile removal check
|
||||
public static final float DEFAULT_BB_WIDTH = 0.6F;
|
||||
public static final float DEFAULT_BB_HEIGHT = 1.8F;
|
||||
public float moveDist;
|
||||
@@ -5035,7 +5036,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public final boolean isRemoved() {
|
||||
- return this.removalReason != null;
|
||||
+ // Leaf start - Async target finding
|
||||
+ // Volatile removal check
|
||||
+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.enabled) {
|
||||
+ return this.isRemoved;
|
||||
+ } else {
|
||||
+ return this.removalReason != null;
|
||||
+ }
|
||||
+ // Leaf end - Async target finding
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -5062,6 +5070,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
|
||||
if (this.removalReason == null) {
|
||||
this.removalReason = removalReason;
|
||||
+ // Leaf start - Async target finding
|
||||
+ // Volatile removal check
|
||||
+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.enabled && this.removalReason != null) {
|
||||
+ this.isRemoved = true;
|
||||
+ }
|
||||
+ // Leaf end - Async target finding
|
||||
}
|
||||
|
||||
if (this.removalReason.shouldDestroy()) {
|
||||
@@ -5081,6 +5095,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
public void unsetRemoved() {
|
||||
this.removalReason = null;
|
||||
+ // Leaf start - Async target finding
|
||||
+ // Volatile removal check
|
||||
+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.enabled) {
|
||||
+ this.isRemoved = false;
|
||||
+ }
|
||||
+ // Leaf end - Async target finding
|
||||
}
|
||||
|
||||
// Paper start - Folia schedulers
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 05d5cde42b7011091ef4ee874c0d9d5586ae3f10..99362471bee4f8404f7cecd860ff339241705d63 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
|
||||
@@ -10,10 +10,10 @@ Paper pull request: https://github.com/PaperMC/Paper/pull/12269
|
||||
Fix Paper#12262 using like the same logic than "pitch/yaw" for set to 0 when a value is NaN
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index f114a8f5143799d72e36e0a535888c5fb25213e1..a81983182ee3e3b874ba83ddf9bbc6ea772a2997 100644
|
||||
index 0903508d2cd3c78602e62dbcff4aa70285bc4c4f..df4b26a6304df92f4eda27ac986ca78d5217ce6c 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -2474,6 +2474,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2473,6 +2473,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -21,7 +21,7 @@ index f114a8f5143799d72e36e0a535888c5fb25213e1..a81983182ee3e3b874ba83ddf9bbc6ea
|
||||
Vec3 deltaMovement = this.getDeltaMovement();
|
||||
compound.put("Motion", this.newDoubleList(deltaMovement.x, deltaMovement.y, deltaMovement.z));
|
||||
// CraftBukkit start - Checking for NaN pitch/yaw and resetting to zero
|
||||
@@ -2620,9 +2621,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2619,9 +2620,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
ListTag list = compound.getList("Pos", 6);
|
||||
ListTag list1 = compound.getList("Motion", 6);
|
||||
ListTag list2 = compound.getList("Rotation", 5);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Sakura: Optimise-check-inside-blocks-and-traverse-blocks
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 2c15f8f0be8ba03f2c9481bed0d46aad738848a0..ad674cf202c61b50f568a36777cee196627b402c 100644
|
||||
index df4b26a6304df92f4eda27ac986ca78d5217ce6c..a4de10a32f49b7b361fc9dd1d142caeef8d7d148 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1711,6 +1711,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1710,6 +1710,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private void checkInsideBlocks(List<Entity.Movement> movements, Set<BlockState> blocksInside) {
|
||||
if (this.isAffectedByBlocks()) {
|
||||
LongSet set = this.visitedBlocks;
|
||||
@@ -20,7 +20,7 @@ index 2c15f8f0be8ba03f2c9481bed0d46aad738848a0..ad674cf202c61b50f568a36777cee196
|
||||
|
||||
for (Entity.Movement movement : movements) {
|
||||
Vec3 vec3 = movement.from();
|
||||
@@ -1722,7 +1727,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1721,7 +1726,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise player movement checks
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index ad674cf202c61b50f568a36777cee196627b402c..5a31ac325af5727a042e4056f67f53013cd33c39 100644
|
||||
index a4de10a32f49b7b361fc9dd1d142caeef8d7d148..5eb740476dff894e91c2bd779ef6b760213a78a5 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1210,7 +1210,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1209,7 +1209,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -126,10 +126,10 @@ index 539206d55e87ec9968664305caaf475c991fe4d5..6cb0c14cb7aa243bbee6ca9ba57da4cc
|
||||
|
||||
private void tickPassenger(Entity ridingEntity, Entity passengerEntity, final boolean isActive) { // Paper - EAR 2
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 5a31ac325af5727a042e4056f67f53013cd33c39..376d8cb183145955b887597ef7ae25ce761a795a 100644
|
||||
index 5eb740476dff894e91c2bd779ef6b760213a78a5..e8a24178cb74afee749bfb067ac010f5178e070c 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1143,31 +1143,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1142,31 +1142,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.onGround;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ index 5a31ac325af5727a042e4056f67f53013cd33c39..376d8cb183145955b887597ef7ae25ce
|
||||
public void move(MoverType type, Vec3 movement) {
|
||||
// Gale start - VMP - skip entity move if movement is zero
|
||||
if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
||||
@@ -1175,16 +1150,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1174,16 +1149,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Gale end - VMP - skip entity move if movement is zero
|
||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||
@@ -178,7 +178,7 @@ index 5a31ac325af5727a042e4056f67f53013cd33c39..376d8cb183145955b887597ef7ae25ce
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -1305,13 +1271,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1304,13 +1270,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Gale end - skip negligible planar movement multiplication
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ index 5a31ac325af5727a042e4056f67f53013cd33c39..376d8cb183145955b887597ef7ae25ce
|
||||
}
|
||||
|
||||
private void applyMovementEmissionAndPlaySound(Entity.MovementEmission movementEmission, Vec3 movement, BlockPos pos, BlockState state) {
|
||||
@@ -4849,9 +4808,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4848,9 +4807,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void setDeltaMovement(Vec3 deltaMovement) {
|
||||
@@ -202,7 +202,7 @@ index 5a31ac325af5727a042e4056f67f53013cd33c39..376d8cb183145955b887597ef7ae25ce
|
||||
}
|
||||
|
||||
public void addDeltaMovement(Vec3 addend) {
|
||||
@@ -4957,9 +4914,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4956,9 +4913,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Paper end - Fix MC-4
|
||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||
|
||||
@@ -34,6 +34,8 @@ public class AsyncTargetFinding extends ConfigModules {
|
||||
asyncTargetFindingInitialized = true;
|
||||
|
||||
enabled = config.getBoolean(getBasePath() + ".enabled", enabled);
|
||||
// TODO
|
||||
enabled = false;
|
||||
alertOther = config.getBoolean(getBasePath() + ".async-alert-other", true);
|
||||
searchBlock = config.getBoolean(getBasePath() + ".async-search-block", true);
|
||||
searchEntity = config.getBoolean(getBasePath() + ".async-search-entity", true);
|
||||
|
||||
Reference in New Issue
Block a user