9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-26 02:29:14 +00:00

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

View File

@@ -36,7 +36,6 @@ public class IrisSettings {
public int configurationVersion = 3;
private IrisSettingsCache cache = new IrisSettingsCache();
private IrisSettingsConcurrency concurrency = new IrisSettingsConcurrency();
private IrisSettingsParallax parallax = new IrisSettingsParallax();
private IrisSettingsGeneral general = new IrisSettingsGeneral();
private IrisSettingsGUI gui = new IrisSettingsGUI();
private IrisSettingsGenerator generator = new IrisSettingsGenerator();
@@ -116,10 +115,6 @@ public class IrisSettings {
return getGui().isUseServerLaunchedGuis();
}
public long getParallaxRegionEvictionMS() {
return getParallax().getParallaxRegionEvictionMS();
}
public void forceSave() {
File s = Iris.instance.getDataFile("settings.json");
@@ -139,21 +134,14 @@ public class IrisSettings {
@Data
public static class IrisSettingsConcurrency {
public int parallelism = -1;
}
@Data
public static class IrisSettingsParallax {
public int parallaxRegionEvictionMS = 15000;
public int parallaxChunkEvictionMS = 5000;
public int parallaxEvictionMS = 10000;
}
@Data
public static class IrisSettingsGeneral {
public boolean commandSounds = true;
public boolean debug = false;
public boolean ignoreWorldEdit = false;
public boolean disableNMS = false;
public boolean keepProductionOnReload = false;
public boolean pluginMetrics = true;
public boolean splashLogoStartup = true;
public boolean autoStartDefaultStudio = false;
@@ -165,7 +153,7 @@ public class IrisSettings {
public int spinb = 8;
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 boolean useServerLaunchedGuis = true;
public boolean maximumPregenGuiFPS = false;
public boolean localPregenGui = true;
}
@Data
public static class IrisSettingsGenerator {
public String defaultWorldType = "overworld";
public boolean headlessPregeneration = false;
public boolean systemEffects = true;
public int maxBiomeChildDepth = 4;
public boolean preventLeafDecay = true;
}

View File

@@ -121,8 +121,7 @@ public class IrisEngine implements Engine {
bud = new AtomicInteger(0);
buds = new AtomicInteger(0);
metrics = new EngineMetrics(32);
cleanLatch = new ChronoLatch(Math.max(10000, Math.min(IrisSettings.get().getParallax()
.getParallaxChunkEvictionMS(), IrisSettings.get().getParallax().getParallaxRegionEvictionMS())));
cleanLatch = new ChronoLatch(Math.max(10000, IrisSettings.get().getConcurrency().getParallaxEvictionMS()));
generatedLast = new AtomicInteger(0);
perSecond = new AtomicDouble(0);
perSecondLatch = new ChronoLatch(1000, false);

View File

@@ -493,7 +493,7 @@ public class B {
return null;
}
if (bx instanceof Leaves && IrisSettings.get().getGenerator().preventLeafDecay) {
if (bx instanceof Leaves && IrisSettings.get().getGenerator().isPreventLeafDecay()) {
((Leaves) bx).setPersistent(true);
} else if (bx instanceof Leaves) {
((Leaves) bx).setPersistent(false);