mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-21 03:15:59 +01:00
Fix whitespace [skip actions]
This commit is contained in:
@@ -28,7 +28,7 @@ public class ConfigContainer {
|
||||
try { // Check if the server is using a legacy config.
|
||||
JsonObject configObject = Grasscutter.getGsonFactory()
|
||||
.fromJson(new FileReader(Grasscutter.configFile), JsonObject.class);
|
||||
if(!configObject.has("version")) {
|
||||
if (!configObject.has("version")) {
|
||||
Grasscutter.getLogger().info("Updating legacy ..");
|
||||
Grasscutter.saveConfig(null);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class ConfigContainer {
|
||||
var existing = config.version;
|
||||
var latest = version();
|
||||
|
||||
if(existing == latest)
|
||||
if (existing == latest)
|
||||
return;
|
||||
|
||||
// Create a new configuration instance.
|
||||
@@ -135,20 +135,20 @@ public class ConfigContainer {
|
||||
public static class Game {
|
||||
public String bindAddress = "0.0.0.0";
|
||||
public int bindPort = 22102;
|
||||
|
||||
|
||||
/* This is the address used in the default region. */
|
||||
public String accessAddress = "127.0.0.1";
|
||||
/* This is the port used in the default region. */
|
||||
public int accessPort = 0;
|
||||
|
||||
|
||||
/* Entities within a certain range will be loaded for the player */
|
||||
public int loadEntitiesForPlayerRange = 100;
|
||||
public boolean enableScriptInBigWorld = false;
|
||||
public boolean enableConsole = true;
|
||||
|
||||
|
||||
/* Controls whether packets should be logged in console or not */
|
||||
public ServerDebugMode logPackets = ServerDebugMode.NONE;
|
||||
|
||||
|
||||
public GameOptions gameOptions = new GameOptions();
|
||||
public JoinOptions joinOptions = new JoinOptions();
|
||||
public ConsoleAccount serverAccount = new ConsoleAccount();
|
||||
@@ -160,7 +160,7 @@ public class ConfigContainer {
|
||||
public Region[] regions = {};
|
||||
|
||||
public String defaultName = "Grasscutter";
|
||||
|
||||
|
||||
public ServerDebugMode logRequests = ServerDebugMode.NONE;
|
||||
}
|
||||
|
||||
@@ -276,4 +276,4 @@ public class ConfigContainer {
|
||||
public String Ip = "127.0.0.1";
|
||||
public int Port = 22102;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,19 +9,19 @@ import static emu.grasscutter.Grasscutter.config;
|
||||
|
||||
/**
|
||||
* A data container for the server's configuration.
|
||||
*
|
||||
*
|
||||
* Use `import static emu.grasscutter.Configuration.*;`
|
||||
* to import all configuration constants.
|
||||
*/
|
||||
public final class Configuration extends ConfigContainer {
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
|
||||
// 'c' is short for 'config' and makes code look 'cleaner'.
|
||||
public static final ConfigContainer c = config;
|
||||
|
||||
|
||||
public static final Locale LANGUAGE = config.language.language;
|
||||
public static final Locale FALLBACK_LANGUAGE = config.language.fallback;
|
||||
public static final String DOCUMENT_LANGUAGE = config.language.document;
|
||||
@@ -30,22 +30,22 @@ public final class Configuration extends ConfigContainer {
|
||||
private static final String PLUGINS_FOLDER = config.folderStructure.plugins;
|
||||
private static final String SCRIPTS_FOLDER = config.folderStructure.scripts;
|
||||
private static final String PACKETS_FOLDER = config.folderStructure.packets;
|
||||
|
||||
|
||||
public static final Server SERVER = config.server;
|
||||
public static final Database DATABASE = config.databaseInfo;
|
||||
public static final Account ACCOUNT = config.account;
|
||||
|
||||
|
||||
public static final HTTP HTTP_INFO = config.server.http;
|
||||
public static final Game GAME_INFO = config.server.game;
|
||||
public static final Dispatch DISPATCH_INFO = config.server.dispatch;
|
||||
|
||||
|
||||
public static final Encryption HTTP_ENCRYPTION = config.server.http.encryption;
|
||||
public static final Policies HTTP_POLICIES = config.server.http.policies;
|
||||
public static final Files HTTP_STATIC_FILES = config.server.http.files;
|
||||
|
||||
|
||||
public static final GameOptions GAME_OPTIONS = config.server.game.gameOptions;
|
||||
public static final GameOptions.InventoryLimits INVENTORY_LIMITS = config.server.game.gameOptions.inventoryLimits;
|
||||
|
||||
|
||||
/*
|
||||
* Utilities
|
||||
*/
|
||||
@@ -56,11 +56,11 @@ public final class Configuration extends ConfigContainer {
|
||||
public static String DATA(String path) {
|
||||
return Paths.get(DATA_FOLDER, path).toString();
|
||||
}
|
||||
|
||||
|
||||
public static String RESOURCE(String path) {
|
||||
return Paths.get(RESOURCES_FOLDER, path).toString();
|
||||
}
|
||||
|
||||
|
||||
public static String PLUGIN() {
|
||||
return PLUGINS_FOLDER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user