SteamWar/FightSystem
Archiviert
13
1

The big refactoring #238

Manuell gemergt
Lixfel hat 16 Commits von refactoring nach master 2021-03-31 20:08:07 +02:00 zusammengeführt
3 geänderte Dateien mit 157 neuen und 79 gelöschten Zeilen
Nur Änderungen aus Commit aeaced502a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -161,6 +161,7 @@ public class Config {
double teamBlueSpawnOffsetX = worldconfig.getDouble("SpawnOffset.x"); double teamBlueSpawnOffsetX = worldconfig.getDouble("SpawnOffset.x");
double teamBlueSpawnOffsetY = worldconfig.getDouble("SpawnOffset.y"); double teamBlueSpawnOffsetY = worldconfig.getDouble("SpawnOffset.y");
double teamBlueSpawnOffsetZ = worldconfig.getDouble("SpawnOffset.z"); double teamBlueSpawnOffsetZ = worldconfig.getDouble("SpawnOffset.z");
WaterDepth = config.getInt("Arena.WaterDepth"); WaterDepth = config.getInt("Arena.WaterDepth");
int schemsizeX = config.getInt("Arena.Schemsize.x"); int schemsizeX = config.getInt("Arena.Schemsize.x");
int schemsizeY = config.getInt("Arena.Schemsize.y"); int schemsizeY = config.getInt("Arena.Schemsize.y");
@ -197,7 +198,7 @@ public class Config {
HiddenBlocks = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlocks"))); HiddenBlocks = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlocks")));
HiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities"))); HiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
ObfuscateWith = config.getString("Techhider.ObfuscateWithTag"); ObfuscateWith = config.getString("Techhider.ObfuscateWith");
TechhiderActive = config.getBoolean("Techhider.Active"); TechhiderActive = config.getBoolean("Techhider.Active");
if(schemsizeX < 0){ if(schemsizeX < 0){

Datei anzeigen

@ -1,90 +1,150 @@
Times: 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 PreSchemPasteDuration: 120
# Time in seconds for preparing
SetupDuration: 300 SetupDuration: 300
# Time in seconds the final countdown is long
PreFightDuration: 30 PreFightDuration: 30
# Time in seconds to spectate the arena after the fight
SpectatorDuration: 30 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: 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 SchematicType: normal
# If the schematics should be rotated during pasting
Rotate: true Rotate: true
ReplaceObsidian: false # If only public schematics are allowed
ReplaceBedrock: false 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: Output:
# Name of the "Red" team
TeamRedName: Rot TeamRedName: Rot
# Color prefix of the "Red" team
TeamRedPrefix: '§c' TeamRedPrefix: '§c'
# Name of the "Blue" team
TeamBlueName: Blau TeamBlueName: Blau
# Color of the "Blue" team
TeamBluePrefix: '§3' TeamBluePrefix: '§3'
GameName: War* # The name of the gamemode presented to the players
GameName: NoGear
# The prefix used for team chats
TeamChatDetection: + TeamChatDetection: +
# The list of active winconditions
WinConditions: WinConditions:
Timeout: true - TIMEOUT
AllDead: true # - HEART_RATIO_TIMEOUT
CaptainDead: false # - PERCENT_TIMEOUT
PercentSystem: false
RelativePercent: false - ALL_DEAD
Points: false # - CAPTAIN_DEAD
Entern: false
TechKO: false # - PERCENT_SYSTEM
WaterTechKO: false # - RELATIVE_PERCENT
HeartRatioTimeout: false # - POINTS
PumpkinTechKO: false
- WATER_TECH_KO
# - TIME_TECH_KO
# - PUMPKIN_TECH_KO
WinConditionParams: WinConditionParams:
# The time of any of the timeout winconditions in seconds
TimeoutTime: 1200 TimeoutTime: 1200
EnterPhaseBegin: 600 # The percentage when any of the percent winconditions limits or triggers a win
PercentWin: 5.0 PercentWin: 5.0
# Blocks ignored by the percent winconditions
IgnoredBlocks: IgnoredBlocks:
- AIR - AIR
- WATER - WATER
- TNT - TNT
- OBSIDIAN - OBSIDIAN
Kits: Kits:
# The kit file for this configuration
File: kits.yml
# The default kit for team members
MemberDefault: default MemberDefault: default
# The default kit for team leaders
LeaderDefault: default LeaderDefault: default
# If the personal kit system is active
PersonalKits: false PersonalKits: false
# Items that are not allowed in the personal kit
ForbiddenItems: [] ForbiddenItems: []
# A list of integers containing the waiting time of this enter stage in the fight
EnterStages: []
Techhider: Techhider:
ObfuscateWith: 121 # if the techhider is active
ObfuscateWithTag: ENDER_STONE 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: HiddenBlocks:
BEDROCK: 7 - water
WATER: 8 - note_block
STATIONARY_WATER: 9 - powered_rail
NOTE_BLOCK: 25 - detector_rail
DETECTOR_RAIL: 28 - piston
PISTON_BASE: 33 - piston_head
PISTON_EXTENSION: 34 - sticky_piston
PISTON_STICKY_BASE: 29 - tnt
POWERED_RAIL: 27 - chest
TNT: 46 - trapped_chest
OBSIDIAN: 49 - redstone_wire
CHEST: 54 - stone_pressure_plate
REDSTONE_WIRE: 55 - iron_door
STONE_PLATE: 70 - oak_pressure_plate
IRON_DOOR_BLOCK: 71 - spruce_pressure_plate
WOOD_PLATE: 72 - birch_pressure_plate
REDSTONE_TORCH_OFF: 75 - jungle_pressure_plate
REDSTONE_TORCH_ON: 76 - acacia_pressure_plate
STONE_BUTTON: 77 - dark_oak_pressure_plate
DIODE_BLOCK_OFF: 93 - redstone_torch
DIODE_BLOCK_ON: 94 - redstone_wall_torch
BREWING_STAND: 117 - repeater
TRIPWIRE_HOOK: 131 - brewing_stand
TRIPWIRE: 132 - tripwire_hook
WOOD_BUTTON: 143 - tripwire
TRAPPED_CHEST: 146 - heavy_weighted_pressure_plate
GOLD_PLATE: 147 - light_weighted_pressure_plate
IRON_PLATE: 148 - comparator
REDSTONE_COMPARATOR_OFF: 149 - redstone_block
REDSTONE_COMPARATOR_ON: 150 - hopper
REDSTONE_BLOCK: 152 - activator_rail
HOPPER: 154 - dropper
ACTIVATOR_RAIL: 157 - slime_block
DROPPER: 158 - observer
SLIME_BLOCK: 165 - honey_block
IRON_TRAPDOOR: 167 - lever
OBSERVER: 218 # The block entities that are hidden (contents of blocks)
LEVER: 69
HiddenBlockEntites: HiddenBlockEntites:
- minecraft:sign - minecraft:sign
- minecraft:dispenser - minecraft:dispenser
@ -98,22 +158,22 @@ Techhider:
- minecraft:jukebox - minecraft:jukebox
- minecraft:comparator - minecraft:comparator
# Muss in config.yml des Weltordners gesetzt werden # The following configuration must be in the Worldforlder/config.yml
Arena: #
Schemsize: # # The lower arena border under which players get damage
x: 0 # UnderBorder:
y: 0 # # The lowest corner in all axis of the blue team schematic area
z: 0 # BlueCorner:
TeamBlueCorner: # x: 0
x: 0 # y: 0
y: 0 # z: 0
z: 0 # # The offset between the lowest corner of the blue area and the lowest corner of the red area
TeamBluetoReddistance: # BlueToRed:
x: 0 # x: 0
y: 0 # y: 0
z: 0 # z: 0
Schem2Border: # # The offset the teams spawn relative to the center of their area
x: 0 # SpawnOffset:
z: 0 # x: 0
underArenaBorder: 0 # y: 0
BorderFromSchematic: 0 # z: 0

Datei anzeigen

@ -23,13 +23,25 @@ import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentCountdown; import de.steamwar.fightsystem.states.StateDependentCountdown;
import de.steamwar.fightsystem.states.StateDependentListener;
import org.bukkit.Bukkit; 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() { public NoPlayersOnlineCountdown() {
super(Config.NoPlayerOnlineDuration, null, false); 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 @Override
@ -37,6 +49,11 @@ public class NoPlayersOnlineCountdown extends Countdown {
return "bis der Server gestoppt wird!"; return "bis der Server gestoppt wird!";
} }
@EventHandler
public void handlePlayerJoin(PlayerJoinEvent event) {
disable();
}
@Override @Override
public void countdownFinished() { public void countdownFinished() {
Bukkit.getServer().shutdown(); Bukkit.getServer().shutdown();