From 673658fab04805894576c1bae4e4ac0f6bc1f57d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 9 Nov 2021 10:28:07 +0100 Subject: [PATCH] WIP config refactoring #2 Signed-off-by: Lixfel --- FightSystem_Core/src/config.yml | 28 ++++++++++++++++--- .../src/de/steamwar/fightsystem/Config.java | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/FightSystem_Core/src/config.yml b/FightSystem_Core/src/config.yml index f17ffe2..7425c26 100644 --- a/FightSystem_Core/src/config.yml +++ b/FightSystem_Core/src/config.yml @@ -1,3 +1,23 @@ +Server: + # Base server folder + Folder: "" + # Server java archive + ServerJar: "" + # Available arenas + Maps: [] + # Names to address the game mode in the chat interface + ChatNames: [] + # If the game mode should be marked as a historic game mode + Historic: false # defaults to false if missing + # If ranked matches should be available for the game mode + Ranked: false # defaults to false if missing + +# The questions that have to be answered to accept the schematic +CheckQuestions: [] # Disables check schem type if missing + +# The available schematic ranks +Ranks: [] # Disables ranks for this schematic type if missing + Times: # Time in seconds the server stops after starting if nobody joins NoPlayersOnlineDuration: 30 # defaults to 30 if missing @@ -28,10 +48,10 @@ Schematic: x: 0 y: 0 z: 0 - # If the rank system for the schematics should be enabled - RanksEnabled: false # defaults to false if missing # The schematic type that can be chosen in this arena - SchematicType: normal # defaults to normal if missing + Type: Normal # defaults to Normal if missing + # Shortcut of the schematic type + Shortcut: "" # defaults to "" if missing # If the schematics should be rotated during pasting Rotate: true # defaults to true if missing # If the schematics should be pasted aligned to the borders instead of centered @@ -179,4 +199,4 @@ Techhider: # SpawnOffset: # x: 0 # defaults to 0 if missing # y: 0 # defaults to Schematic.Size.y if missing -# z: 0 # defaults to 0 if missing \ No newline at end of file +# z: 0 # defaults to 0 if missing diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index 943d5ae..3b2b7d2 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -168,7 +168,7 @@ public class Config { int schemsizeX = config.getInt("Schematic.Size.x"); int schemsizeY = config.getInt("Schematic.Size.y"); int schemsizeZ = config.getInt("Schematic.Size.z"); - RanksEnabled = config.getBoolean("Schematic.RanksEnabled", false); + RanksEnabled = !config.getStringList("Ranks").isEmpty(); SchematicType = de.steamwar.sql.SchematicType.fromDB(Objects.requireNonNull(config.getString("Schematic.SchematicType", "normal"))); IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly", false); boolean rotate = config.getBoolean("Schematic.Rotate", true);