Make MB_MINION_SPAWN_TIME a required ConfigManager entry

0 or blank keeps the normal guard/siege minion spawn timers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-18 08:00:53 -04:00
1 parent becab380d2
commit 963130565e
2 files changed
+12 -7

No files matched your search

@@ -75,6 +75,7 @@ public enum ConfigManager {
// Mobile AI modifiers
MB_AI_CAST_FREQUENCY,
MB_AI_AGGRO_RANGE,
MB_MINION_SPAWN_TIME,
//drop rates
MB_NORMAL_EXP_RATE,
+11 -7
View File
@@ -41,9 +41,6 @@ import static java.lang.Math.toIntExact;
public class Mob extends AbstractIntelligenceAgent implements Delayed {
private static int staticID = 0;
// Optional env var (seconds) to shorten guard/siege minion spawns for testing; not in the ConfigManager enum, which requires every entry.
private static final String MINION_SPAWN_TIME_FLAG = "MB_MINION_SPAWN_TIME";
//mob specific
public final ConcurrentHashMap<Integer, Float> playerAgroMap = new ConcurrentHashMap<>(); //key = Player value = hate value
@@ -439,21 +436,28 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
return mobile;
}
// MB_MINION_SPAWN_TIME (seconds) shortens guard/siege minion spawns for testing; 0 or blank keeps the normal timers.
private static int minionSpawnDelay(int defaultDelay) {
String overrideValue;
int overrideDelay;
overrideValue = ConfigManager.configMap.get(MINION_SPAWN_TIME_FLAG);
overrideValue = ConfigManager.MB_MINION_SPAWN_TIME.getValue();
if (overrideValue == null || overrideValue.isEmpty())
if (overrideValue == null || overrideValue.trim().isEmpty())
return defaultDelay;
try {
return Integer.parseInt(overrideValue.trim());
overrideDelay = Integer.parseInt(overrideValue.trim());
} catch (NumberFormatException e) {
Logger.warn(MINION_SPAWN_TIME_FLAG + " is not a number: " + overrideValue);
Logger.warn("MB_MINION_SPAWN_TIME is not a number: " + overrideValue);
return defaultDelay;
}
if (overrideDelay <= 0)
return defaultDelay;
return overrideDelay;
}
public static synchronized Mob createGuardMinion(Mob guardCaptain, short level, String minionName) {