Configurable hardcore difficulty

This commit is contained in:
Sotr
2018-07-09 17:34:51 +08:00
parent d223e4ad00
commit a6a51f9805
2 changed files with 6 additions and 0 deletions

View File

@@ -279,4 +279,9 @@ public class AkarinGlobalConfig {
private static void sendLightOnlyChunkSection() {
sendLightOnlyChunkSection = getBoolean("core.send-light-only-chunk-sections", true);
}
public static boolean forceHardcoreDifficulty;
private static void forceHardcoreDifficulty() {
forceHardcoreDifficulty = getBoolean("alternative.force-difficulty-on-hardcore", true);
}
}

View File

@@ -75,6 +75,7 @@ public class AkarinSlackScheduler extends Thread {
}
// Force hardcore difficulty, from WorldServer#doTick
if (AkarinGlobalConfig.forceHardcoreDifficulty)
for (WorldServer world : server.worlds) {
if (world.getWorldData().isHardcore() && world.getDifficulty() != EnumDifficulty.HARD) {
world.getWorldData().setDifficulty(EnumDifficulty.HARD);