|
1 | 1 | package org.cyclops.integratedscripting; |
2 | 2 |
|
3 | | -import net.neoforged.fml.config.ModConfig; |
4 | | -import org.cyclops.cyclopscore.config.ConfigurableProperty; |
5 | | -import org.cyclops.cyclopscore.config.extendedconfig.DummyConfig; |
6 | | -import org.cyclops.cyclopscore.tracking.Versions; |
| 3 | +import org.cyclops.cyclopscore.config.ConfigurablePropertyCommon; |
| 4 | +import org.cyclops.cyclopscore.config.ModConfigLocation; |
| 5 | +import org.cyclops.cyclopscore.config.extendedconfig.DummyConfigCommon; |
| 6 | +import org.cyclops.cyclopscore.init.IModBase; |
7 | 7 |
|
8 | 8 | /** |
9 | 9 | * A config with general options for this mod. |
10 | 10 | * @author rubensworks |
11 | 11 | * |
12 | 12 | */ |
13 | | -public class GeneralConfig extends DummyConfig { |
| 13 | +public class GeneralConfig extends DummyConfigCommon<IModBase> { |
14 | 14 |
|
15 | | - @ConfigurableProperty(category = "core", comment = "If the version checker should be enabled.") |
| 15 | + @ConfigurablePropertyCommon(category = "core", comment = "If the version checker should be enabled.") |
16 | 16 | public static boolean versionChecker = true; |
17 | 17 |
|
18 | | - @ConfigurableProperty(category = "general", comment = "The base energy usage for the scripting drive.", minimalValue = 0, configLocation = ModConfig.Type.SERVER) |
| 18 | + @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the scripting drive.", minimalValue = 0, configLocation = ModConfigLocation.SERVER) |
19 | 19 | public static int scriptingDriveBaseConsumption = 2; |
20 | | - @ConfigurableProperty(category = "general", comment = "The base energy usage for the scripting terminal.", minimalValue = 0, configLocation = ModConfig.Type.SERVER) |
| 20 | + @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the scripting terminal.", minimalValue = 0, configLocation = ModConfigLocation.SERVER) |
21 | 21 | public static int terminalScriptingBaseConsumption = 1; |
22 | | - @ConfigurableProperty(category = "general", comment = "The minimum number of ticks inbetween sending a script change packet from client to server.", minimalValue = 0, configLocation = ModConfig.Type.SERVER) |
| 22 | + @ConfigurablePropertyCommon(category = "general", comment = "The minimum number of ticks inbetween sending a script change packet from client to server.", minimalValue = 0, configLocation = ModConfigLocation.SERVER) |
23 | 23 | public static int terminalScriptingClientSyncTickInterval = 20; |
24 | 24 |
|
25 | | - @ConfigurableProperty(category = "general", comment = "If new processes can be created from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 25 | + @ConfigurablePropertyCommon(category = "general", comment = "If new processes can be created from guest languages.", configLocation = ModConfigLocation.SERVER) |
26 | 26 | public static boolean graalAllowCreateProcess = false; |
27 | | - @ConfigurableProperty(category = "general", comment = "If new threads can be created from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 27 | + @ConfigurablePropertyCommon(category = "general", comment = "If new threads can be created from guest languages.", configLocation = ModConfigLocation.SERVER) |
28 | 28 | public static boolean graalAllowCreateThread = false; |
29 | | - @ConfigurableProperty(category = "general", comment = "If IO is allowed from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 29 | + @ConfigurablePropertyCommon(category = "general", comment = "If IO is allowed from guest languages.", configLocation = ModConfigLocation.SERVER) |
30 | 30 | public static boolean graalAllowIo = false; |
31 | | - @ConfigurableProperty(category = "general", comment = "If host class loading is allowed from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 31 | + @ConfigurablePropertyCommon(category = "general", comment = "If host class loading is allowed from guest languages.", configLocation = ModConfigLocation.SERVER) |
32 | 32 | public static boolean graalAllowHostClassLoading = false; |
33 | | - @ConfigurableProperty(category = "general", comment = "If experimental options can be used in guest languages.", configLocation = ModConfig.Type.SERVER) |
| 33 | + @ConfigurablePropertyCommon(category = "general", comment = "If experimental options can be used in guest languages.", configLocation = ModConfigLocation.SERVER) |
34 | 34 | public static boolean graalAllowExperimentalOptions = false; |
35 | | - @ConfigurableProperty(category = "general", comment = "If environment variables can be accessed from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 35 | + @ConfigurablePropertyCommon(category = "general", comment = "If environment variables can be accessed from guest languages.", configLocation = ModConfigLocation.SERVER) |
36 | 36 | public static boolean graalAllowEnvironment = false; |
37 | | - @ConfigurableProperty(category = "general", comment = "If the native interface can be accessed from guest languages.", configLocation = ModConfig.Type.SERVER) |
| 37 | + @ConfigurablePropertyCommon(category = "general", comment = "If the native interface can be accessed from guest languages.", configLocation = ModConfigLocation.SERVER) |
38 | 38 | public static boolean graalAllowNative = false; |
39 | | - @ConfigurableProperty(category = "general", comment = "The maximum number of statements that can be executed in one evaluation. This is to avoid infinite loops or very complex programs. Set to -1 to disable limit (not recommended).", configLocation = ModConfig.Type.SERVER, minimalValue = -1) |
| 39 | + @ConfigurablePropertyCommon(category = "general", comment = "The maximum number of statements that can be executed in one evaluation. This is to avoid infinite loops or very complex programs. Set to -1 to disable limit (not recommended).", configLocation = ModConfigLocation.SERVER, minimalValue = -1) |
40 | 40 | public static int graalStatementLimit = 16384; |
41 | | - @ConfigurableProperty(category = "general", comment = "The maximum number of lines in stdout and stderr script log files. Set to -1 to disable limit.", minimalValue = -1, configLocation = ModConfig.Type.SERVER) |
| 41 | + @ConfigurablePropertyCommon(category = "general", comment = "The maximum number of lines in stdout and stderr script log files. Set to -1 to disable limit.", minimalValue = -1, configLocation = ModConfigLocation.SERVER) |
42 | 42 | public static int maxLogLines = 2096; |
43 | 43 |
|
44 | 44 | public GeneralConfig() { |
45 | 45 | super(IntegratedScripting._instance, "general"); |
46 | 46 | } |
47 | | - |
48 | | - @Override |
49 | | - public void onRegistered() { |
50 | | - if(versionChecker) { |
51 | | - Versions.registerMod(getMod(), IntegratedScripting._instance, Reference.VERSION_URL); |
52 | | - } |
53 | | - } |
54 | 47 | } |
0 commit comments