Skip to content

Commit

Permalink
Add More*6 Performance Improvements by Pufferfish
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Aug 21, 2022
1 parent 8989609 commit 53087c1
Show file tree
Hide file tree
Showing 25 changed files with 363 additions and 54 deletions.
10 changes: 7 additions & 3 deletions patches/server/0018-Optimize-mob-spawning.patch
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,22 @@ index 4cdfc433df67afcd455422e9baf56f167dd712ae..a6e0f5dab21d806e0c7744b2a337cded
private void ensureActiveIsNotIterated() {
// Paper - replace with better logic, do not delay removals
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 857b8881ba2d526ee366aa04228b72bc8d7c8c47..7430ba59d0d16c628a7c62100902e23b0470b419 100644
index 857b8881ba2d526ee366aa04228b72bc8d7c8c47..6f0d0c255e7767c31605effbcb0b41659f0b8ddb 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -222,7 +222,12 @@ public final class LeavesConfig {
@@ -222,7 +222,16 @@ public final class LeavesConfig {
}
noChatSign = getBoolean("settings.misc.no-chat-sign", noChatSign);
}
-
+
+ public static boolean asyncMobSpawning = false;
+ private static boolean asyncMobSpawningLock = false;
+ private static void asyncMobSpawning() {
+ asyncMobSpawning = getBoolean("settings.performance.async-mob-spawning", asyncMobSpawning);
+ if (!asyncMobSpawningLock) {
+ asyncMobSpawning = getBoolean("settings.performance.async-mob-spawning", asyncMobSpawning);
+ asyncMobSpawningLock = true;
+ }
+ }
+
public static final class WorldConfig {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0019-Dont-send-useless-entity-packets.patch
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ index 3b144c820531122eb37d41be06c182b5f5dc0724..8eb4a062489b42b26076d5f3bdfbff36
this.entity.stopSeenByPlayer(player);
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 7430ba59d0d16c628a7c62100902e23b0470b419..26e23a21f7cbd8d5e9a2dbf4860adc03a04e6e0e 100644
index 6f0d0c255e7767c31605effbcb0b41659f0b8ddb..f4e5b84f0bd952676950369eff44b87fe1c46f1b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -228,6 +228,11 @@ public final class LeavesConfig {
asyncMobSpawning = getBoolean("settings.performance.async-mob-spawning", asyncMobSpawning);
@@ -232,6 +232,11 @@ public final class LeavesConfig {
}
}

+ public static boolean dontSendUselessEntityPackets = true;
Expand Down
10 changes: 7 additions & 3 deletions patches/server/0020-Multithreaded-Tracker.patch
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,20 @@ index 8eb4a062489b42b26076d5f3bdfbff368c1a199b..441edf3dbd34c8d15b7b1ba02c92e8f1

set.clear();
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 26e23a21f7cbd8d5e9a2dbf4860adc03a04e6e0e..51130d4d0f95af0d3ee508e83e69697783c31106 100644
index f4e5b84f0bd952676950369eff44b87fe1c46f1b..1ef5e16bc44369eefd58df7d93e031ca83ce7190 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -233,6 +233,11 @@ public final class LeavesConfig {
@@ -237,6 +237,15 @@ public final class LeavesConfig {
dontSendUselessEntityPackets = getBoolean("settings.performance.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
}

+ public static boolean asyncEntityTracker = false;
+ private static boolean asyncEntityTrackerLock = false;
+ private static void asyncEntityTracker() {
+ asyncEntityTracker = getBoolean("settings.performance.async-entity-tracker", asyncEntityTracker);
+ if (!asyncEntityTrackerLock) {
+ asyncEntityTracker = getBoolean("settings.performance.async-entity-tracker", asyncEntityTracker);
+ asyncEntityTrackerLock = true;
+ }
+ }
+
public static final class WorldConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ index 26bf383caea68834c654b25653ced9017f1b1b22..71e3c7fc5c071e83dfeca6954771e559
this.blockPos = mutableBlockPos;
setTargetPosition(mutableBlockPos.immutable()); // Paper
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 51130d4d0f95af0d3ee508e83e69697783c31106..f157ee3c0b37fab427c9ce97ac3d28ddca831f8b 100644
index 1ef5e16bc44369eefd58df7d93e031ca83ce7190..51c71e922fa98dd30d52d89b1d8d4be77eff491b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -238,6 +238,11 @@ public final class LeavesConfig {
asyncEntityTracker = getBoolean("settings.performance.async-entity-tracker", asyncEntityTracker);
@@ -246,6 +246,11 @@ public final class LeavesConfig {
}
}

+ public static boolean fixPaper6045 = true;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0022-Optimize-entity-coordinate-key.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ index eda98b85fb00fe7787d2f7a643c3854aa4b02fbf..1f1bed78e8d003cfd85bc5cf38014c3d
private Vec3 deltaMovement;
public float yRot; // Paper - private->public
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index f157ee3c0b37fab427c9ce97ac3d28ddca831f8b..fbdead4eaeee7bb730c23d6228ae939ce9c01971 100644
index 51c71e922fa98dd30d52d89b1d8d4be77eff491b..338aef7429790cb24bacb790c0180d5516c9c3ba 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -243,6 +243,11 @@ public final class LeavesConfig {
@@ -251,6 +251,11 @@ public final class LeavesConfig {
fixPaper6045 = getBoolean("settings.performance.fix.fix-paper-6045", fixPaper6045);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0023-Optimize-suffocation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ index 2dee51917888e20768f434b8232430094028b516..8f9bbe88827b6697762f4d43dce1da39
public boolean hurt(DamageSource source, float amount) {
if (this.isInvulnerableTo(source)) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index fbdead4eaeee7bb730c23d6228ae939ce9c01971..6091a783878f929edfb87cf88963590538c72634 100644
index 338aef7429790cb24bacb790c0180d5516c9c3ba..4e241398ea555e3696ad969aa37c51311116b92e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -248,6 +248,11 @@ public final class LeavesConfig {
@@ -256,6 +256,11 @@ public final class LeavesConfig {
optimizeEntityCoordinateKey = getBoolean("settings.performance.optimize-entity-coordinate-key", optimizeEntityCoordinateKey);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ index fd18fb454263893d404979a9c9af860ee2ba9a3a..1bd4a181ccf82c687f58b8033683f15a
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 6091a783878f929edfb87cf88963590538c72634..76c4110c54c8a883fd015a434c7b101fa3fbb18b 100644
index 4e241398ea555e3696ad969aa37c51311116b92e..8de03a1d05888308b64007d78dc01f6be58fd730 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -253,6 +253,11 @@ public final class LeavesConfig {
@@ -261,6 +261,11 @@ public final class LeavesConfig {
enableSuffocationOptimization = getBoolean("settings.performance.enable-suffocation-optimization", enableSuffocationOptimization);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ index 50d4595b81f24949011c7565c5e3fc8c26c86019..8de1653e3fbf29e9de550a1976344bd8
@Override
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 76c4110c54c8a883fd015a434c7b101fa3fbb18b..a675e5ebf5d8ee2ff7dfc86fe93293f1366b886a 100644
index 8de03a1d05888308b64007d78dc01f6be58fd730..f5c07942038a51400e6cdbaee264ad869ebe8b7b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -258,6 +258,11 @@ public final class LeavesConfig {
@@ -266,6 +266,11 @@ public final class LeavesConfig {
entityStripRaytracing = getBoolean("settings.performance.strip-raytracing-for-entity", entityStripRaytracing);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ index 2292cb0e0c1a3e0ed34b941f028136bfb0bff13e..a6ea5fd73cb1f6b3c6c35d0cde331b6c

public org.bukkit.Chunk bukkitChunk;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index a675e5ebf5d8ee2ff7dfc86fe93293f1366b886a..f01a5349f59a98cb80b06d6b48d23bcd6cc59eb3 100644
index f5c07942038a51400e6cdbaee264ad869ebe8b7b..a5f51eefcff48e5a5e44b5143f80b87be06676c3 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -263,6 +263,11 @@ public final class LeavesConfig {
@@ -271,6 +271,11 @@ public final class LeavesConfig {
checkSpookySeasonOnceAnHour = getBoolean("settings.performance.check-spooky-season-once-an-hour", checkSpookySeasonOnceAnHour);
}

+ public static boolean optimizeChunkTicking = true;
+ public static boolean optimizeChunkTicking = false;
+ private static void optimizeChunkTicking() {
+ optimizeChunkTicking = getBoolean("settings.performance.optimize-chunk-ticking", optimizeChunkTicking);
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ index 43243537b765a2d270be6de3f053fea77ff67d18..7d8a137068ab2b33690c369f4da46e90
this.batchCache.long2ObjectEntrySet().removeIf((entry) -> {
return !entry.getValue().isStillValid(time);
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index f01a5349f59a98cb80b06d6b48d23bcd6cc59eb3..4112467e6e72b31ec0963d69800da758c089a0a0 100644
index a5f51eefcff48e5a5e44b5143f80b87be06676c3..f00104ea447d83f4fa94352296b9ae78cd46b765 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -268,6 +268,11 @@ public final class LeavesConfig {
@@ -276,6 +276,11 @@ public final class LeavesConfig {
optimizeChunkTicking = getBoolean("settings.performance.optimize-chunk-ticking", optimizeChunkTicking);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ index a7575b5ef56af6f53448d391abb4956e130148ca..e2764cbc888be39943728ff810e1e44b
return false;
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 4112467e6e72b31ec0963d69800da758c089a0a0..2da10eaf3dc4fce1edf65fe4068f5c9e30df3b17 100644
index f00104ea447d83f4fa94352296b9ae78cd46b765..5a56cae5ef2a256b5b70e8b0bebdea4a88431f0b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -272,6 +272,11 @@ public final class LeavesConfig {
@@ -280,6 +280,11 @@ public final class LeavesConfig {
private static void skipPOIFindingInVehicle() {
skipPOIFindingInVehicle = getBoolean("settings.performance.skip-poi-find-in-vehicle", skipPOIFindingInVehicle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ index e31a2eea9a62ab2c0bed1a97dab6bae231b8cd8b..cc851e1a9c5b23269c53206a7f1e14f3

public static boolean isValidEmptySpawnBlock(BlockGetter blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType<?> entityType) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 2da10eaf3dc4fce1edf65fe4068f5c9e30df3b17..f7f2c18112fc711edda300753ce2f465fe75ba7f 100644
index 5a56cae5ef2a256b5b70e8b0bebdea4a88431f0b..c0b01e0aee7fcb66f2940225069366ef02b6ef2a 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -278,6 +278,11 @@ public final class LeavesConfig {
@@ -286,6 +286,11 @@ public final class LeavesConfig {
entityTargetFindingOptimization = getBoolean("settings.performance.entity-target-find-optimization", entityTargetFindingOptimization);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0031-Config-to-disable-method-profiler.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ index 6832efb59d9efdfbc3ec38a219193b503f57cabe..7b2ec2afb29f4141a1cc2736e3d6c07d
}

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index f7f2c18112fc711edda300753ce2f465fe75ba7f..bf0cf0bc2e26c58fb4bef13258947e0021e9ace5 100644
index c0b01e0aee7fcb66f2940225069366ef02b6ef2a..306415241dbe86eac20b2011ac7676dbca032644 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -283,6 +283,11 @@ public final class LeavesConfig {
@@ -291,6 +291,11 @@ public final class LeavesConfig {
useMoreThreadUnsafeRandom = getBoolean("settings.performance.use-more-thread-unsafe-random", useMoreThreadUnsafeRandom);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ index 3646b969fa51b9683ab4137e530c3a6f6fc6c465..ed06eaa8bcd8246483115d2dfcb1de23
}
if (this.targetSelector.inactiveTick()) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index bf0cf0bc2e26c58fb4bef13258947e0021e9ace5..111787b63f67b1fdcac559faf1cc0eb7d6f0984e 100644
index 306415241dbe86eac20b2011ac7676dbca032644..85d13feec033d3939dbbe8f1684aa408796a1706 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -288,6 +288,11 @@ public final class LeavesConfig {
@@ -296,6 +296,11 @@ public final class LeavesConfig {
disableMethodProfiler = getBoolean("settings.misc.disable-method-profiler", disableMethodProfiler);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0033-Skip-cloning-loot-parameters.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ index 35f9b11a3a61976c952a2c1c64bb2a932538f54f..5d678cfca0a39aeed0881c3a38828fdc

public boolean hasParam(LootContextParam<?> parameter) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 111787b63f67b1fdcac559faf1cc0eb7d6f0984e..1e7b428f4e8fef77bdc8eae43216fe113484fdcc 100644
index 85d13feec033d3939dbbe8f1684aa408796a1706..d14eb8bf345552559708bd028bfe5c76d1de3720 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -293,6 +293,11 @@ public final class LeavesConfig {
@@ -301,6 +301,11 @@ public final class LeavesConfig {
throttleInactiveGoalSelectorTick = getBoolean("settings.performance.inactive-goal-selector-disable", throttleInactiveGoalSelectorTick);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0034-Reduce-entity-allocations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ index c770ee21b7b699522941f6a1584d532001c04082..a0672f21797ff90e8bb6b16d3aaa671b

public boolean hasAttribute(Attribute attribute) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 1e7b428f4e8fef77bdc8eae43216fe113484fdcc..afdb9c047d9f06c6dee5cec24393d5dd5bc9546b 100644
index d14eb8bf345552559708bd028bfe5c76d1de3720..ddb1ed98be6bcdcd6604025c7996432d613697d8 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -298,6 +298,11 @@ public final class LeavesConfig {
@@ -306,6 +306,11 @@ public final class LeavesConfig {
skipCloneLootParameters = getBoolean("settings.performance.skip-clone-loot-parameters", skipCloneLootParameters);
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0035-Remove-lambda-from-ticking-guard.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ index bb360a8a54fa4efe1cc6b672df09d4c0d6816d16..82fdf9ae2af5e36b2a8b74ec92d604d1
}
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index afdb9c047d9f06c6dee5cec24393d5dd5bc9546b..5c35fe757b7dfffb7570a36e49f13fa2e4680a3a 100644
index ddb1ed98be6bcdcd6604025c7996432d613697d8..cfc8289915c95596991661e42fe5894aac9225c2 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -303,6 +303,11 @@ public final class LeavesConfig {
@@ -311,6 +311,11 @@ public final class LeavesConfig {
reduceEntityAllocations = getBoolean("settings.performance.reduce-entity-allocations", reduceEntityAllocations);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ index a1a625a8dacf4d2bbf75ddd90dce1b1be663c919..038c5fae763c5d387a23aaacc3264ab3
}

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 5c35fe757b7dfffb7570a36e49f13fa2e4680a3a..8b4095c0e8797482bca3800ad9dfc4f894e63f85 100644
index cfc8289915c95596991661e42fe5894aac9225c2..2c4b7a4c69721bfdd6cf8b9f06663dc3ad875fe3 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -308,6 +308,11 @@ public final class LeavesConfig {
@@ -316,6 +316,11 @@ public final class LeavesConfig {
removeTickGuardLambda = getBoolean("settings.performance.remove.tick-guard-lambda", removeTickGuardLambda);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ index 66cecf64fac0b72590e1a4ea7147ea2ac78dd30a..2a55e56b80e2835ca8b3975f3b34e008
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 8b4095c0e8797482bca3800ad9dfc4f894e63f85..d797792d4c26ba70c08e0b96f0a611c379b07105 100644
index 2c4b7a4c69721bfdd6cf8b9f06663dc3ad875fe3..b4555c7beabd15666be6869432d0cb92484a8df8 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -313,6 +313,11 @@ public final class LeavesConfig {
@@ -321,6 +321,11 @@ public final class LeavesConfig {
removeInventoryContainsIterators = getBoolean("settings.performance.remove.inventory-contains-iterators", removeInventoryContainsIterators);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ index 6c95663869b9d7a545393df0416332a509306bb5..b5ac10207ef5d500b36547322459f19e
return this.scaledRange(i);
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d797792d4c26ba70c08e0b96f0a611c379b07105..1c36dd6bdaa0bc11b0a7e082fdcd2061c19a333b 100644
index b4555c7beabd15666be6869432d0cb92484a8df8..9845b7397c7c3a1e0229d40c054353c4a489e542 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -318,6 +318,11 @@ public final class LeavesConfig {
@@ -326,6 +326,11 @@ public final class LeavesConfig {
removeGetNearPlayerStreams = getBoolean("settings.performance.remove.get-nearby-players-streams", removeGetNearPlayerStreams);
}

Expand Down
10 changes: 7 additions & 3 deletions patches/server/0039-Async-Pathfinding.patch
Original file line number Diff line number Diff line change
Expand Up @@ -756,16 +756,20 @@ index d23481453717f715124156b5d83f6448f720d049..6cc6140f44827ccc055aafdd6bfb3a09
protected float distance(Node a, Node b) {
return a.distanceTo(b);
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 1c36dd6bdaa0bc11b0a7e082fdcd2061c19a333b..1203a5efe08cf6b3606f12c60672bd933718d52a 100644
index 9845b7397c7c3a1e0229d40c054353c4a489e542..9636d6b7494c937071ea685dad9da06acba6149b 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -323,6 +323,11 @@ public final class LeavesConfig {
@@ -331,6 +331,15 @@ public final class LeavesConfig {
removeRangeCheckStreams = getBoolean("settings.performance.remove.range-check-streams-and-iterators", removeRangeCheckStreams);
}

+ public static boolean asyncPathfinding = false;
+ private static boolean asyncPathfindingLock = false;
+ private static void asyncPathfinding() {
+ asyncPathfinding = getBoolean("settings.performance.async-pathfinding", asyncPathfinding);
+ if (!asyncPathfindingLock) {
+ asyncPathfinding = getBoolean("settings.performance.async-pathfinding", asyncPathfinding);
+ asyncPathfindingLock = true;
+ }
+ }
+
public static final class WorldConfig {
Expand Down
Loading

0 comments on commit 53087c1

Please sign in to comment.