9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 09:59:15 +00:00

threshold config

This commit is contained in:
hayanesuru
2025-05-09 11:28:49 +09:00
parent 49cc2a0f92
commit 08287d95db
2 changed files with 7 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ public class AsyncGoalExecutor {
submit(id);
}
}
if ((tickCount & 10L) == 10L) {
if ((tickCount % AsyncTargetFinding.threshold) == 0L) {
unpark();
}
tickCount += 1;

View File

@@ -16,6 +16,7 @@ public class AsyncTargetFinding extends ConfigModules {
public static boolean searchBlock = true;
public static boolean searchEntity = true;
public static int queueSize = 4096;
public static long threshold = 10L;
private static boolean asyncTargetFindingInitialized;
@Override
@@ -36,11 +37,15 @@ public class AsyncTargetFinding extends ConfigModules {
alertOther = config.getBoolean(getBasePath() + ".async-alert-other", true);
searchBlock = config.getBoolean(getBasePath() + ".async-search-block", true);
searchEntity = config.getBoolean(getBasePath() + ".async-search-entity", true);
queueSize = config.getInt(getBasePath() + ".queue-size", 4096);
queueSize = config.getInt(getBasePath() + ".queue-size", 0);
threshold = config.getLong(getBasePath() + ".threshold", 0);
if (queueSize <= 0) {
queueSize = 4096;
}
if (threshold <= 0L) {
threshold = 10L;
}
if (!enabled) {
alertOther = false;
searchEntity = false;