From aeaced502a3c42f1319079f211650dad640650e3 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 23 Mar 2021 19:54:05 +0100 Subject: [PATCH] Update default config Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/Config.java | 3 +- FightSystem_Main/src/config.yml | 212 +++++++++++------- .../countdown/NoPlayersOnlineCountdown.java | 21 +- 3 files changed, 157 insertions(+), 79 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index 29a84bf..3db29fe 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -161,6 +161,7 @@ public class Config { double teamBlueSpawnOffsetX = worldconfig.getDouble("SpawnOffset.x"); double teamBlueSpawnOffsetY = worldconfig.getDouble("SpawnOffset.y"); double teamBlueSpawnOffsetZ = worldconfig.getDouble("SpawnOffset.z"); + WaterDepth = config.getInt("Arena.WaterDepth"); int schemsizeX = config.getInt("Arena.Schemsize.x"); int schemsizeY = config.getInt("Arena.Schemsize.y"); @@ -197,7 +198,7 @@ public class Config { HiddenBlocks = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlocks"))); HiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities"))); - ObfuscateWith = config.getString("Techhider.ObfuscateWithTag"); + ObfuscateWith = config.getString("Techhider.ObfuscateWith"); TechhiderActive = config.getBoolean("Techhider.Active"); if(schemsizeX < 0){ diff --git a/FightSystem_Main/src/config.yml b/FightSystem_Main/src/config.yml index 7b64223..ed8dafb 100644 --- a/FightSystem_Main/src/config.yml +++ b/FightSystem_Main/src/config.yml @@ -1,90 +1,150 @@ Times: - NoPlayersOnlineDuration: 300 + # Time in seconds the server stops after starting if nobody joins + NoPlayersOnlineDuration: 30 + # Time in seconds the team leaders have to choose their schematic PreSchemPasteDuration: 120 + # Time in seconds for preparing SetupDuration: 300 + # Time in seconds the final countdown is long PreFightDuration: 30 + # Time in seconds to spectate the arena after the fight SpectatorDuration: 30 + +Arena: + # The amount of blocks the schematics should be pasted under the surface + WaterDepth: 0 + # The size of the schematics + Schemsize: + x: 0 + y: 0 + z: 0 + # The outer border of the arena, measured in blocks around the schematic areas + Schem2Border: + x: 0 + z: 0 + # The size of the team areas are expanded around the schematics + BorderFromSchematic: 0 + # If ground walkable, teams can walk below the lower arena border during setup + GroundWalkable: true + Schematic: - OnlyPublicSchematics: false + # If the rank system for the schematics should be enabled + RanksEnabled: false + # The schematic type that can be chosen in this arena SchematicType: normal + # If the schematics should be rotated during pasting Rotate: true - ReplaceObsidian: false - ReplaceBedrock: false + # If only public schematics are allowed + OnlyPublicSchematics: false + # If the public only force should be completly disabled + IgnorePublicOnly: false + # If obsidian and bedrock should be replaced during PRE_RUNNING + ReplaceObsidianBedrock: false + # If the replacement should happen with blockupdates + ReplaceWithBlockupdates: false + Output: + # Name of the "Red" team TeamRedName: Rot + # Color prefix of the "Red" team TeamRedPrefix: '§c' + # Name of the "Blue" team TeamBlueName: Blau + # Color of the "Blue" team TeamBluePrefix: '§3' - GameName: War* + # The name of the gamemode presented to the players + GameName: NoGear + # The prefix used for team chats TeamChatDetection: + + +# The list of active winconditions WinConditions: - Timeout: true - AllDead: true - CaptainDead: false - PercentSystem: false - RelativePercent: false - Points: false - Entern: false - TechKO: false - WaterTechKO: false - HeartRatioTimeout: false - PumpkinTechKO: false + - TIMEOUT + # - HEART_RATIO_TIMEOUT + # - PERCENT_TIMEOUT + + - ALL_DEAD + # - CAPTAIN_DEAD + + # - PERCENT_SYSTEM + # - RELATIVE_PERCENT + # - POINTS + + - WATER_TECH_KO + # - TIME_TECH_KO + # - PUMPKIN_TECH_KO + WinConditionParams: + # The time of any of the timeout winconditions in seconds TimeoutTime: 1200 - EnterPhaseBegin: 600 + # The percentage when any of the percent winconditions limits or triggers a win PercentWin: 5.0 + # Blocks ignored by the percent winconditions IgnoredBlocks: - AIR - WATER - TNT - OBSIDIAN + Kits: + # The kit file for this configuration + File: kits.yml + # The default kit for team members MemberDefault: default + # The default kit for team leaders LeaderDefault: default + # If the personal kit system is active PersonalKits: false + # Items that are not allowed in the personal kit ForbiddenItems: [] + +# A list of integers containing the waiting time of this enter stage in the fight +EnterStages: [] + Techhider: - ObfuscateWith: 121 - ObfuscateWithTag: ENDER_STONE + # if the techhider is active + Active: true + # Which block the techhider replaces to. + ObfuscateWith: end_stone + # A list of all hidden blocks. "water" results in the hiding of all waterlogged blocks as well. HiddenBlocks: - BEDROCK: 7 - WATER: 8 - STATIONARY_WATER: 9 - NOTE_BLOCK: 25 - DETECTOR_RAIL: 28 - PISTON_BASE: 33 - PISTON_EXTENSION: 34 - PISTON_STICKY_BASE: 29 - POWERED_RAIL: 27 - TNT: 46 - OBSIDIAN: 49 - CHEST: 54 - REDSTONE_WIRE: 55 - STONE_PLATE: 70 - IRON_DOOR_BLOCK: 71 - WOOD_PLATE: 72 - REDSTONE_TORCH_OFF: 75 - REDSTONE_TORCH_ON: 76 - STONE_BUTTON: 77 - DIODE_BLOCK_OFF: 93 - DIODE_BLOCK_ON: 94 - BREWING_STAND: 117 - TRIPWIRE_HOOK: 131 - TRIPWIRE: 132 - WOOD_BUTTON: 143 - TRAPPED_CHEST: 146 - GOLD_PLATE: 147 - IRON_PLATE: 148 - REDSTONE_COMPARATOR_OFF: 149 - REDSTONE_COMPARATOR_ON: 150 - REDSTONE_BLOCK: 152 - HOPPER: 154 - ACTIVATOR_RAIL: 157 - DROPPER: 158 - SLIME_BLOCK: 165 - IRON_TRAPDOOR: 167 - OBSERVER: 218 - LEVER: 69 + - water + - note_block + - powered_rail + - detector_rail + - piston + - piston_head + - sticky_piston + - tnt + - chest + - trapped_chest + - redstone_wire + - stone_pressure_plate + - iron_door + - oak_pressure_plate + - spruce_pressure_plate + - birch_pressure_plate + - jungle_pressure_plate + - acacia_pressure_plate + - dark_oak_pressure_plate + - redstone_torch + - redstone_wall_torch + - repeater + - brewing_stand + - tripwire_hook + - tripwire + - heavy_weighted_pressure_plate + - light_weighted_pressure_plate + - comparator + - redstone_block + - hopper + - activator_rail + - dropper + - slime_block + - observer + - honey_block + - lever + # The block entities that are hidden (contents of blocks) HiddenBlockEntites: - minecraft:sign - minecraft:dispenser @@ -98,22 +158,22 @@ Techhider: - minecraft:jukebox - minecraft:comparator -# Muss in config.yml des Weltordners gesetzt werden -Arena: - Schemsize: - x: 0 - y: 0 - z: 0 - TeamBlueCorner: - x: 0 - y: 0 - z: 0 - TeamBluetoReddistance: - x: 0 - y: 0 - z: 0 - Schem2Border: - x: 0 - z: 0 - underArenaBorder: 0 - BorderFromSchematic: 0 \ No newline at end of file +# The following configuration must be in the Worldforlder/config.yml +# +# # The lower arena border under which players get damage +# UnderBorder: +# # The lowest corner in all axis of the blue team schematic area +# BlueCorner: +# x: 0 +# y: 0 +# z: 0 +# # The offset between the lowest corner of the blue area and the lowest corner of the red area +# BlueToRed: +# x: 0 +# y: 0 +# z: 0 +# # The offset the teams spawn relative to the center of their area +# SpawnOffset: +# x: 0 +# y: 0 +# z: 0 \ No newline at end of file diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/NoPlayersOnlineCountdown.java b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/NoPlayersOnlineCountdown.java index 8c81c7b..fc8ed95 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/NoPlayersOnlineCountdown.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/NoPlayersOnlineCountdown.java @@ -23,13 +23,25 @@ import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentCountdown; +import de.steamwar.fightsystem.states.StateDependentListener; import org.bukkit.Bukkit; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; -public class NoPlayersOnlineCountdown extends Countdown { +public class NoPlayersOnlineCountdown extends Countdown implements Listener { public NoPlayersOnlineCountdown() { super(Config.NoPlayerOnlineDuration, null, false); - new StateDependentCountdown(ArenaMode.All, FightState.PreLeaderSetup, this); + + new StateDependentListener(ArenaMode.All, FightState.PreLeaderSetup, this); + new StateDependentCountdown(ArenaMode.All, FightState.PreLeaderSetup, this){ + @Override + public void enable() { + if(Bukkit.getOnlinePlayers().isEmpty()) + super.enable(); + } + }; } @Override @@ -37,6 +49,11 @@ public class NoPlayersOnlineCountdown extends Countdown { return "bis der Server gestoppt wird!"; } + @EventHandler + public void handlePlayerJoin(PlayerJoinEvent event) { + disable(); + } + @Override public void countdownFinished() { Bukkit.getServer().shutdown();