SteamWar/FightSystem
Archiviert
13
1

Single file gamemode, arena, schematic config #304

Zusammengeführt
Lixfel hat 5 Commits von configRefactoring nach master 2021-12-02 14:26:19 +01:00 zusammengeführt
3 geänderte Dateien mit 149 neuen und 168 gelöschten Zeilen

Datei anzeigen

@ -1,64 +1,92 @@
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
NoPlayersOnlineDuration: 30 # defaults to 30 if missing
# Time in seconds the team leaders have to choose their schematic
PreSchemPasteDuration: 120
PreSchemPasteDuration: 120 # defaults to 120 if missing
# Time in seconds for preparing
SetupDuration: 300
SetupDuration: 300 # defaults to 300 if missing
# Time in seconds the final countdown is long
PreFightDuration: 30
PreFightDuration: 30 # defaults to 30 if missing
# Time in seconds to spectate the arena after the fight
SpectatorDuration: 30
SpectatorDuration: 30 # defaults to 30 if missing
Arena:
# The amount of blocks the schematics should be pasted under the surface
WaterDepth: 0
WaterDepth: 0 # defaults to 0 if missing
# The outer border of the arena, measured in blocks around the schematic areas
Schem2Border:
x: 24 # defaults to 24 if missing
z: 24 # defaults to 24 if missing
# The size of the team areas are expanded around the schematics
BorderFromSchematic: 12 # defaults to 12 if missing
# If ground walkable, teams can walk below the lower arena border during setup
GroundWalkable: true # defaults to true if missing
Schematic:
# The size of the schematics
Schemsize:
Size:
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:
# If the rank system for the schematics should be enabled
RanksEnabled: false
# The schematic type that can be chosen in this arena
SchematicType: normal
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
Rotate: true # defaults to true if missing
# If the schematics should be pasted aligned to the borders instead of centered
PasteAligned: false # defaults to false if missing
# If only public schematics are allowed
OnlyPublicSchematics: false
# If the public only force should be completly disabled
IgnorePublicOnly: false
OnlyPublicSchematics: false # defaults to false if missing
# If the public only force should be completely disabled
IgnorePublicOnly: false # defaults to false if missing
# If obsidian and bedrock should be replaced during PRE_RUNNING
ReplaceObsidianBedrock: false
ReplaceObsidianBedrock: false # defaults to false if missing
# If the replacement should happen with block updates
ReplaceWithBlockupdates: false
ReplaceWithBlockupdates: false # defaults to false if missing
# Maximal amount of blocks allowed in the schematic
MaxBlocks: 0 # defaults to 0 (ignored) if missing
# Maximal amount of items per dispenser
MaxDispenserItems: 128 # defaults to 128 if missing
# List of limited material (combinations)
# List contains tags Amount (integer) and Materials (List of material names in Spigot 1.12 AND Spigot 1.15 format)
Limited:
- Materials: []
Amount: 0
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'
# The name of the game mode presented to the players
GameName: NoGear
GameName: WarGear # defaults to WarGear if missing
# The prefix used for team chats
TeamChatDetection: +
TeamChatPrefix: + # defaults to + if missing
Blue:
Name: Blau # defaults to Blue if missing
Prefix: '§3' # defaults to '§3' if missing
Red:
Name: Rot # defaults to Red if missing
Prefix: '§c' # defaults to '§c' if missing
# The list of active win conditions
WinConditions:
WinConditions: # defaults to none if missing
- TIMEOUT
# - HEART_RATIO_TIMEOUT
# - PERCENT_TIMEOUT
@ -67,101 +95,54 @@ WinConditions:
# - CAPTAIN_DEAD
# - PERCENT_SYSTEM
# - WHITELIST_PERCENT
# - RELATIVE_PERCENT
# - POINTS
- WATER_TECH_KO
# - WATER_TECH_KO
# - TIME_TECH_KO
# - PUMPKIN_TECH_KO
# - HELLS_BELLS
WinConditionParams:
# The time of any of the timeout win conditions in seconds
TimeoutTime: 1200
TimeoutTime: 1200 # defaults to 1200 if missing
# The percentage when any of the percent win conditions limits or triggers a win
PercentWin: 5.0
# Blocks ignored by the percent winconditions
IgnoredBlocks:
- AIR
- WATER
- TNT
- OBSIDIAN
PercentWin: 7.0 # defaults to 7.0 if missing
# Special Blocks (Valid spigot material values) used by the percent win conditions
Blocks: [] # defaults to none if missing
Kits:
# The kit file for this configuration
File: kits.yml
File: kits.yml # defaults to kits.yml if missing
# The default kit for team members
MemberDefault: default
MemberDefault: default # defaults to default if missing
# The default kit for team leaders
LeaderDefault: default
LeaderDefault: default # defaults to default if missing
# If the personal kit system is active
PersonalKits: false
# Items that are not allowed in the personal kit
ForbiddenItems: []
PersonalKits: false # defaults to false if missing
# Items (Valid spigot material values) that are not allowed in the personal kit
ForbiddenItems: [] # defaults to none if missing
# A list of integers containing the waiting time of this enter stage in the fight
EnterStages: []
EnterStages: [] # defaults to no enter stages (empty list) if missing
Techhider:
# if the techhider is active
Active: true
# The tech hider blocks/materials have to be valid lowercase minecraft material names
# Activates the tech hider
Active: false # defaults to false if missing
# Which block the tech hider replaces to.
ObfuscateWith: end_stone
ObfuscateWith: end_stone # defaults to end_stone if missing
# A list of all hidden blocks. "water" results in the hiding of all waterlogged blocks as well.
HiddenBlocks:
- 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
- minecraft:chest
- minecraft:trapped_chest
- minecraft:furnace
- minecraft:brewing_stand
- minecraft:hopper
- minecraft:dropper
- minecraft:shulker_box
- minecraft:jukebox
- minecraft:comparator
HiddenBlocks: [] # defaults to none if missing
# The block entity contents that are hidden (here with minecraft:nametag)
HiddenBlockEntites: [] # defaults to none if missing
# The following configuration must be in the Worldforlder/config.yml
# The following configuration must be in the world folder/config.yml
#
# # The lower arena border under which players get damage
# UnderBorder:
# UnderBorder: 0 # defaults to BlueCorner.y if missing
# # The lowest corner in all axis of the blue team schematic area
# BlueCorner:
# x: 0
@ -169,11 +150,11 @@ Techhider:
# 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
# x: 0 # defaults to 0 if missing
# y: 0 # defaults to 0 if missing
# z: 0 # defaults to Schematic.Size.z + 50 if missing
# # The offset the teams spawn relative to the center of their area
# SpawnOffset:
# x: 0
# y: 0
# z: 0
# x: 0 # defaults to 0 if missing
# y: 0 # defaults to Schematic.Size.y if missing
# z: 0 # defaults to 0 if missing

Datei anzeigen

@ -104,7 +104,7 @@ public class Config {
public static final String MemberDefault;
public static final String LeaderDefault;
public static final boolean PersonalKits;
public static final List<String> ForbiddenItems;
public static final Set<Material> ForbiddenItems;
public static final String KitFile;
//tech hider parameter
@ -148,61 +148,55 @@ public class Config {
}
FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile);
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");
PreSchemPasteDuration = config.getInt("Times.PreSchemPasteDuration");
SetupDuration = config.getInt("Times.SetupDuration");
PreFightDuration = config.getInt("Times.PreFightDuration");
SpectatorDuration = config.getInt("Times.SpectatorDuration");
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration", 30);
PreSchemPasteDuration = config.getInt("Times.PreSchemPasteDuration", 120);
SetupDuration = config.getInt("Times.SetupDuration", 300);
PreFightDuration = config.getInt("Times.PreFightDuration", 30);
SpectatorDuration = config.getInt("Times.SpectatorDuration", 30);
int underBorder = worldconfig.getInt("UnderBorder");
int blueCornerX = worldconfig.getInt("BlueCorner.x");
int blueCornerY = worldconfig.getInt("BlueCorner.y");
int blueCornerZ = worldconfig.getInt("BlueCorner.z");
BlueToRedX = worldconfig.getInt("BlueToRed.x");
BlueToRedY = worldconfig.getInt("BlueToRed.y");
BlueToRedZ = worldconfig.getInt("BlueToRed.z");
double teamBlueSpawnOffsetX = worldconfig.getDouble("SpawnOffset.x");
double teamBlueSpawnOffsetY = worldconfig.getDouble("SpawnOffset.y");
double teamBlueSpawnOffsetZ = worldconfig.getDouble("SpawnOffset.z");
int underBorder = worldconfig.getInt("UnderBorder", blueCornerY);
WaterDepth = config.getInt("Arena.WaterDepth");
int schemsizeX = config.getInt("Arena.Schemsize.x");
int schemsizeY = config.getInt("Arena.Schemsize.y");
int schemsizeZ = config.getInt("Arena.Schemsize.z");
int schem2BorderX = config.getInt("Arena.Schem2Border.x");
int schem2BorderZ = config.getInt("Arena.Schem2Border.z");
PreperationArea = config.getInt("Arena.BorderFromSchematic");
GroundWalkable = config.getBoolean("Arena.GroundWalkable");
WaterDepth = config.getInt("Arena.WaterDepth", 0);
int schem2BorderX = config.getInt("Arena.Schem2Border.x", 24);
int schem2BorderZ = config.getInt("Arena.Schem2Border.z", 24);
PreperationArea = config.getInt("Arena.BorderFromSchematic", 12);
GroundWalkable = config.getBoolean("Arena.GroundWalkable", true);
RanksEnabled = config.getBoolean("Schematic.RanksEnabled");
SchematicType = de.steamwar.sql.SchematicType.fromDB(Objects.requireNonNull(config.getString("Schematic.SchematicType")));
IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly");
boolean rotate = config.getBoolean("Schematic.Rotate");
PasteAligned = config.getBoolean("Schematic.PasteAligned");
ReplaceObsidianBedrock = config.getBoolean("Schematic.ReplaceObsidianBedrock");
ReplaceWithBlockupdates = config.getBoolean("Schematic.ReplaceWithBlockupdates");
int schemsizeX = config.getInt("Schematic.Size.x");
int schemsizeY = config.getInt("Schematic.Size.y");
int schemsizeZ = config.getInt("Schematic.Size.z");
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);
PasteAligned = config.getBoolean("Schematic.PasteAligned", false);
ReplaceObsidianBedrock = config.getBoolean("Schematic.ReplaceObsidianBedrock", false);
ReplaceWithBlockupdates = config.getBoolean("Schematic.ReplaceWithBlockupdates", false);
GameName = config.getString("Output.GameName");
TeamChatDetection = config.getString("Output.TeamChatDetection");
GameName = config.getString("GameName", "WarGear");
TeamChatDetection = config.getString("TeamChatPrefix", "+");
ActiveWinconditions = Collections.unmodifiableSet(config.getStringList("WinConditions").stream().map(Winconditions::valueOf).collect(Collectors.toSet()));
TimeoutTime = config.getInt("WinConditionParams.TimeoutTime");
PercentWin = config.getDouble("WinConditionParams.PercentWin");
PercentBlocks = config.getStringList("WinConditionParams.IgnoredBlocks").stream().map(Material::valueOf).collect(Collectors.toSet());
TimeoutTime = config.getInt("WinConditionParams.TimeoutTime", 1200);
PercentWin = config.getDouble("WinConditionParams.PercentWin", 7.0);
PercentBlocks = Collections.unmodifiableSet(config.getStringList("WinConditionParams.Blocks").stream().map(Material::valueOf).collect(Collectors.toSet()));
EnterStages = Collections.unmodifiableList(config.getIntegerList("EnterStages"));
KitFile = config.getString("Kits.File");
MemberDefault = config.getString("Kits.MemberDefault");
LeaderDefault = config.getString("Kits.LeaderDefault");
PersonalKits = config.getBoolean("Kits.PersonalKits");
ForbiddenItems = Collections.unmodifiableList(config.getStringList("Kits.ForbiddenItems"));
KitFile = config.getString("Kits.File", "kits.yml");
MemberDefault = config.getString("Kits.MemberDefault", "default");
LeaderDefault = config.getString("Kits.LeaderDefault", "default");
PersonalKits = config.getBoolean("Kits.PersonalKits", false);
ForbiddenItems = Collections.unmodifiableSet(config.getStringList("Kits.ForbiddenItems").stream().map(Material::valueOf).collect(Collectors.toSet()));
TechhiderActive = config.getBoolean("Techhider.Active", false);
ObfuscateWith = config.getString("Techhider.ObfuscateWith", "end_stone");
HiddenBlocks = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlocks")));
HiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
ObfuscateWith = config.getString("Techhider.ObfuscateWith");
TechhiderActive = config.getBoolean("Techhider.Active");
if(schemsizeX < 0){
schemsizeX = -schemsizeX;
@ -217,6 +211,12 @@ public class Config {
blueCornerZ = blueCornerZ - schemsizeZ;
}
BlueToRedX = worldconfig.getInt("BlueToRed.x", 0);
BlueToRedY = worldconfig.getInt("BlueToRed.y", 0);
BlueToRedZ = worldconfig.getInt("BlueToRed.z", schemsizeZ + 50);
double teamBlueSpawnOffsetX = worldconfig.getDouble("SpawnOffset.x", 0);
double teamBlueSpawnOffsetY = worldconfig.getDouble("SpawnOffset.y", schemsizeY);
double teamBlueSpawnOffsetZ = worldconfig.getDouble("SpawnOffset.z", 0);
int teamRedCornerX = BlueToRedX + blueCornerX;
int teamRedCornerY = BlueToRedY + blueCornerY;
@ -341,11 +341,11 @@ public class Config {
LiveReplay = event.spectateSystem();
}else{
//No event
TeamRedColor = config.getString("Output.TeamRedPrefix");
TeamBlueColor = config.getString("Output.TeamBluePrefix");
TeamRedName = config.getString("Output.TeamRedName");
TeamBlueName = config.getString("Output.TeamBlueName");
OnlyPublicSchematics = config.getBoolean("Schematic.OnlyPublicSchematics");
TeamRedColor = config.getString("Red.Prefix", "§c");
TeamBlueColor = config.getString("Blue.Prefix", "§3");
TeamRedName = config.getString("Red.Name", "Red");
TeamBlueName = config.getString("Blue.Name", "Blue");
OnlyPublicSchematics = config.getBoolean("Schematic.OnlyPublicSchematics", false);
EventTeamBlueID = 0;
EventTeamRedID = 0;
BothTeamsPublic = true;

Datei anzeigen

@ -183,7 +183,7 @@ public class Kit {
return false;
//Check for forbidden item
if(Config.ForbiddenItems.contains(stack.getType().name()))
if(Config.ForbiddenItems.contains(stack.getType()))
return true;
//Check for attribute modifiers