From 3c4d5123da175cf8239b292c7a6c4204eafedf91 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 19 Jan 2020 17:32:29 +0100 Subject: [PATCH] Ignore Public Only rule (for historic gamemodes) Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/Config.java | 2 ++ .../src/de/steamwar/fightsystem/fight/Fight.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index aa0782d..b4f251d 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -61,6 +61,7 @@ public class Config { //schematic parameter public static final boolean OnlyPublicSchematics; + public static final boolean IgnorePublicOnly; public static final de.steamwar.sql.SchematicType SchematicType; public static final boolean TeamRedRotate; public static final boolean TeamBlueRotate; @@ -149,6 +150,7 @@ public class Config { WaterDepth = worldconfig.getInt("Arena.WaterDepth"); SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType")); + IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly"); boolean rotate = config.getBoolean("Schematic.Rotate"); ReplaceObsidian = config.getBoolean("Schematic.ReplaceObsidian"); ReplaceBedrock = config.getBoolean("Schematic.ReplaceBedrock"); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/Fight.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/Fight.java index 31a7886..b5a6e25 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/Fight.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/Fight.java @@ -114,6 +114,16 @@ public class Fight { } public static void calcAvailibleSchemTypes() { + if(Config.IgnorePublicOnly){ + onlyPublicSchems = false; + return; + } + + if(Config.OnlyPublicSchematics){ + onlyPublicSchems = true; + return; + } + if(redTeam.getLeader() == null || redTeam.getLeader().getPlayer() == null || blueTeam.getLeader() == null || blueTeam.getLeader().getPlayer() == null){ onlyPublicSchems = false;