Simplify settings

This commit is contained in:
CocoTheOwner
2021-09-10 01:35:26 +02:00
parent c3b1d6735e
commit c5bf0e0cb7
3 changed files with 4 additions and 19 deletions
@@ -36,7 +36,6 @@ public class IrisSettings {
public int configurationVersion = 3; public int configurationVersion = 3;
private IrisSettingsCache cache = new IrisSettingsCache(); private IrisSettingsCache cache = new IrisSettingsCache();
private IrisSettingsConcurrency concurrency = new IrisSettingsConcurrency(); private IrisSettingsConcurrency concurrency = new IrisSettingsConcurrency();
private IrisSettingsParallax parallax = new IrisSettingsParallax();
private IrisSettingsGeneral general = new IrisSettingsGeneral(); private IrisSettingsGeneral general = new IrisSettingsGeneral();
private IrisSettingsGUI gui = new IrisSettingsGUI(); private IrisSettingsGUI gui = new IrisSettingsGUI();
private IrisSettingsGenerator generator = new IrisSettingsGenerator(); private IrisSettingsGenerator generator = new IrisSettingsGenerator();
@@ -116,10 +115,6 @@ public class IrisSettings {
return getGui().isUseServerLaunchedGuis(); return getGui().isUseServerLaunchedGuis();
} }
public long getParallaxRegionEvictionMS() {
return getParallax().getParallaxRegionEvictionMS();
}
public void forceSave() { public void forceSave() {
File s = Iris.instance.getDataFile("settings.json"); File s = Iris.instance.getDataFile("settings.json");
@@ -139,21 +134,14 @@ public class IrisSettings {
@Data @Data
public static class IrisSettingsConcurrency { public static class IrisSettingsConcurrency {
public int parallelism = -1; public int parallelism = -1;
} public int parallaxEvictionMS = 10000;
@Data
public static class IrisSettingsParallax {
public int parallaxRegionEvictionMS = 15000;
public int parallaxChunkEvictionMS = 5000;
} }
@Data @Data
public static class IrisSettingsGeneral { public static class IrisSettingsGeneral {
public boolean commandSounds = true; public boolean commandSounds = true;
public boolean debug = false; public boolean debug = false;
public boolean ignoreWorldEdit = false;
public boolean disableNMS = false; public boolean disableNMS = false;
public boolean keepProductionOnReload = false;
public boolean pluginMetrics = true; public boolean pluginMetrics = true;
public boolean splashLogoStartup = true; public boolean splashLogoStartup = true;
public boolean autoStartDefaultStudio = false; public boolean autoStartDefaultStudio = false;
@@ -165,7 +153,7 @@ public class IrisSettings {
public int spinb = 8; public int spinb = 8;
public boolean canUseCustomColors(VolmitSender volmitSender) { public boolean canUseCustomColors(VolmitSender volmitSender) {
return (volmitSender.isPlayer() && useCustomColorsIngame) || (!volmitSender.isPlayer() && useConsoleCustomColors); return volmitSender.isPlayer() ? useCustomColorsIngame : useConsoleCustomColors;
} }
} }
@@ -173,14 +161,12 @@ public class IrisSettings {
public static class IrisSettingsGUI { public static class IrisSettingsGUI {
public boolean useServerLaunchedGuis = true; public boolean useServerLaunchedGuis = true;
public boolean maximumPregenGuiFPS = false; public boolean maximumPregenGuiFPS = false;
public boolean localPregenGui = true;
} }
@Data @Data
public static class IrisSettingsGenerator { public static class IrisSettingsGenerator {
public String defaultWorldType = "overworld"; public String defaultWorldType = "overworld";
public boolean headlessPregeneration = false; public boolean headlessPregeneration = false;
public boolean systemEffects = true;
public int maxBiomeChildDepth = 4; public int maxBiomeChildDepth = 4;
public boolean preventLeafDecay = true; public boolean preventLeafDecay = true;
} }
@@ -121,8 +121,7 @@ public class IrisEngine implements Engine {
bud = new AtomicInteger(0); bud = new AtomicInteger(0);
buds = new AtomicInteger(0); buds = new AtomicInteger(0);
metrics = new EngineMetrics(32); metrics = new EngineMetrics(32);
cleanLatch = new ChronoLatch(Math.max(10000, Math.min(IrisSettings.get().getParallax() cleanLatch = new ChronoLatch(Math.max(10000, IrisSettings.get().getConcurrency().getParallaxEvictionMS()));
.getParallaxChunkEvictionMS(), IrisSettings.get().getParallax().getParallaxRegionEvictionMS())));
generatedLast = new AtomicInteger(0); generatedLast = new AtomicInteger(0);
perSecond = new AtomicDouble(0); perSecond = new AtomicDouble(0);
perSecondLatch = new ChronoLatch(1000, false); perSecondLatch = new ChronoLatch(1000, false);
@@ -493,7 +493,7 @@ public class B {
return null; return null;
} }
if (bx instanceof Leaves && IrisSettings.get().getGenerator().preventLeafDecay) { if (bx instanceof Leaves && IrisSettings.get().getGenerator().isPreventLeafDecay()) {
((Leaves) bx).setPersistent(true); ((Leaves) bx).setPersistent(true);
} else if (bx instanceof Leaves) { } else if (bx instanceof Leaves) {
((Leaves) bx).setPersistent(false); ((Leaves) bx).setPersistent(false);