9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-23 17:09:26 +00:00
Files
LeavesMC/patches/server/0039-Async-Pathfinding.patch
2023-04-16 20:57:25 +08:00

35 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Wed, 17 Aug 2022 16:54:54 +0800
Subject: [PATCH] Async Pathfinding
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
But Pufferfish patch was ported downstream from the Petal fork
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 91087dc6d9429f0ccca1194bcf25f52bd264febb..cf3de827f8a2f1a48546e17327e71d1fa5b7058a 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -349,6 +349,21 @@ public final class LeavesConfig {
removeRangeCheckStreams = getBoolean("settings.performance.remove.range-check-streams-and-iterators", removeRangeCheckStreams);
}
+ // only config now
+ public static boolean asyncPathfinding = false;
+ private static boolean asyncPathfindingLock = false;
+ private static void asyncPathfinding() {
+ if (!asyncPathfindingLock) {
+ asyncPathfinding = getBoolean("settings.performance.async-pathfinding", asyncPathfinding);
+ asyncPathfindingLock = true;
+ }
+
+ if (asyncPathfinding) {
+ asyncPathfinding = false;
+ LeavesLogger.LOGGER.severe("Async Pathfinding is updating, it can't work");
+ }
+ }
+
public static final class WorldConfig {
public final String worldName;