forked from SteamWar/SteamWar
Add Unified GameModeConfig
This commit is contained in:
@@ -12,11 +12,11 @@ Server:
|
||||
# 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
|
||||
# Submission deadline for schematics in 'dd.MM.yyyy HH:mm' format
|
||||
Deadline: null # defaults to null if missing
|
||||
|
||||
# The available schematic ranks
|
||||
Ranks: [] # Disables ranks for this schematic type if missing
|
||||
# The questions that have to be answered to accept the schematic
|
||||
CheckQuestions: [] # Disables check schem type if missing
|
||||
|
||||
Times:
|
||||
# Time in seconds the server stops after starting if nobody joins
|
||||
@@ -52,6 +52,8 @@ Arena:
|
||||
Leaveable: false # defaults to false if missing
|
||||
# Allow missiles to fly to the enemy and not stop at the schem border.
|
||||
AllowMissiles: false # defaults to true if EnterStages are present otherwise 'false'
|
||||
# Denotes that there is no floor for this GameMode
|
||||
NoFloor: false # defaults to false if missing
|
||||
|
||||
Schematic:
|
||||
# The size of the schematics
|
||||
@@ -59,6 +61,12 @@ Schematic:
|
||||
x: 0
|
||||
y: 0
|
||||
z: 0
|
||||
# Used for GameModes with a technic area
|
||||
Inset:
|
||||
x: 0
|
||||
z: 0
|
||||
top: 0
|
||||
bottom: 0
|
||||
# The schematic type that can be chosen in this arena
|
||||
Type: Normal # defaults to Normal if missing
|
||||
# The schematic types that are also allowed to be chosen in this arena
|
||||
@@ -87,6 +95,8 @@ Schematic:
|
||||
MaxBlocks: 0 # defaults to 0 (ignored) if missing
|
||||
# Maximal amount of items per dispenser
|
||||
MaxDispenserItems: 128 # defaults to 128 if missing
|
||||
# Maximal blast resistance for the design blocks
|
||||
MaxDesignBlastResistance: 100000000 # defaults to Double.MAX_VALUE 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:
|
||||
@@ -95,6 +105,9 @@ Schematic:
|
||||
|
||||
# The name of the game mode presented to the players
|
||||
GameName: WarGear # defaults to WarGear if missing
|
||||
# The months this game mode should be active and playable
|
||||
# The empty List means all of them
|
||||
ActiveMonths: [] # defaults to none if missing
|
||||
# The prefix used for team chats
|
||||
TeamChatPrefix: + # defaults to + if missing
|
||||
Blue:
|
||||
@@ -137,6 +150,8 @@ WinConditionParams:
|
||||
BlocksWhitelist: false # defaults to false if missing
|
||||
# Special Blocks (Valid spigot material values) used by the percent win conditions
|
||||
Blocks: [] # defaults to none if missing
|
||||
# Time for being declared TechKo without a shot given.
|
||||
TechKoTime: 90 # defaults to 90 if missing
|
||||
|
||||
Kits:
|
||||
# The kit file for this configuration
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem;
|
||||
|
||||
import de.steamwar.data.GameModeConfig;
|
||||
import de.steamwar.data.YMLWrapperImpl;
|
||||
import de.steamwar.fightsystem.utils.Region;
|
||||
import de.steamwar.fightsystem.winconditions.Winconditions;
|
||||
import de.steamwar.sql.*;
|
||||
@@ -32,9 +34,10 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Config {
|
||||
|
||||
@@ -42,15 +45,7 @@ public class Config {
|
||||
|
||||
public static final World world = Bukkit.getWorlds().get(0);
|
||||
|
||||
//Fight sequence
|
||||
public static final int NoPlayerOnlineDuration;
|
||||
public static final int PreSchemPasteDuration;
|
||||
public static final int SetupDuration;
|
||||
public static final int PreFightDuration;
|
||||
public static final int SpectatorDuration;
|
||||
|
||||
// entern parameter
|
||||
public static final List<Integer> EnterStages;
|
||||
public static final GameModeConfig<Material, SchematicType, Winconditions> GameModeConfig;
|
||||
|
||||
//arena parameter
|
||||
public static final Region BluePasteRegion;
|
||||
@@ -69,60 +64,20 @@ public class Config {
|
||||
private static final int BlueToRedY;
|
||||
public static final int BlueToRedZ;
|
||||
|
||||
public static final int PreperationArea;
|
||||
public static final int WaterDepth;
|
||||
public static final boolean GroundWalkable;
|
||||
public static final boolean DisableSnowMelt;
|
||||
public static final boolean ArenaLeaveable;
|
||||
public static final boolean AllowMissiles;
|
||||
|
||||
//schematic parameter
|
||||
public static final boolean RanksEnabled;
|
||||
public static final boolean OnlyPublicSchematics;
|
||||
public static final boolean IgnorePublicOnly;
|
||||
public static final de.steamwar.sql.SchematicType SchematicType;
|
||||
public static final List<de.steamwar.sql.SchematicType> SubTypes;
|
||||
|
||||
public static final boolean RedRotate;
|
||||
public static final boolean BlueRotate;
|
||||
public static final boolean PasteAligned;
|
||||
public static final boolean ReplaceObsidianBedrock;
|
||||
public static final boolean ReplaceWithBlockupdates;
|
||||
public static final boolean UnlimitedPrepare;
|
||||
|
||||
//team parameter
|
||||
public static final String TeamRedName;
|
||||
public static final String TeamBlueName;
|
||||
public static final String TeamRedColor;
|
||||
public static final String TeamBlueColor;
|
||||
public static final String GameName;
|
||||
public static final String TeamChatDetection;
|
||||
public static final UUID BlueLeader;
|
||||
public static final UUID RedLeader;
|
||||
|
||||
//Active win conditions
|
||||
public static final Set<Winconditions> ActiveWinconditions;
|
||||
|
||||
//win condition parameters
|
||||
public static final int TimeoutTime;
|
||||
public static final double PercentWin;
|
||||
public static final boolean PercentEntern;
|
||||
public static final boolean PercentBlocksWhitelist;
|
||||
public static final Set<Material> PercentBlocks;
|
||||
public static final int TechKoTime;
|
||||
|
||||
//default kits
|
||||
public static final String MemberDefault;
|
||||
public static final String LeaderDefault;
|
||||
public static final boolean PersonalKits;
|
||||
public static final Set<Material> ForbiddenItems;
|
||||
public static final String KitFile;
|
||||
|
||||
//tech hider parameter
|
||||
public static final boolean TechhiderActive;
|
||||
public static final Set<Material> HiddenBlocks;
|
||||
public static final Set<String> HiddenBlockEntities;
|
||||
public static final Material ObfuscateWith;
|
||||
|
||||
//event parameter
|
||||
public static final EventFight EventKampf;
|
||||
private static final Set<Integer> Referees;
|
||||
@@ -154,7 +109,7 @@ public class Config {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Arenaconfig fehlt!");
|
||||
Bukkit.shutdown();
|
||||
}
|
||||
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(FightSystem.getPlugin().getDataFolder(), configFile));
|
||||
GameModeConfig = new GameModeConfig<>(YMLWrapperImpl.ofTyped(new File(FightSystem.getPlugin().getDataFolder(), configFile), Winconditions::valueOf));
|
||||
|
||||
File worldConfigFile = new File(world.getWorldFolder(), "config.yml");
|
||||
if(!worldConfigFile.exists()) {
|
||||
@@ -163,111 +118,37 @@ public class Config {
|
||||
}
|
||||
FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile);
|
||||
|
||||
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration", 300);
|
||||
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 blueCornerX = worldconfig.getInt("BlueCorner.x");
|
||||
int blueCornerY = worldconfig.getInt("BlueCorner.y");
|
||||
int blueCornerZ = worldconfig.getInt("BlueCorner.z");
|
||||
int underBorder = worldconfig.getInt("UnderBorder", blueCornerY);
|
||||
|
||||
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);
|
||||
DisableSnowMelt = config.getBoolean("Arena.DisableSnowMelt", false);
|
||||
ArenaLeaveable = config.getBoolean("Arena.Leaveable", false);
|
||||
|
||||
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.Type", "normal")));
|
||||
SubTypes = config.getStringList("Schematic.SubTypes").stream().map(de.steamwar.sql.SchematicType::fromDB).collect(Collectors.toList());
|
||||
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);
|
||||
UnlimitedPrepare = config.getBoolean("Schematic.UnlimitedPrepare", false);
|
||||
|
||||
int schemInsetX = config.getInt("Schematic.Inset.x", 0);
|
||||
int schemInsetZ = config.getInt("Schematic.Inset.z", 0);
|
||||
int schemInsetBottom = config.getInt("Schematic.Inset.bottom", 0);
|
||||
int schemInsetTop = config.getInt("Schematic.Inset.top", 0);
|
||||
|
||||
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", 1200);
|
||||
PercentWin = config.getDouble("WinConditionParams.PercentWin", 7.0);
|
||||
PercentEntern = config.getBoolean("WinConditionParams.PercentEntern", true);
|
||||
PercentBlocksWhitelist = config.getBoolean("WinConditionParams.BlocksWhitelist", false);
|
||||
PercentBlocks = Collections.unmodifiableSet(config.getStringList("WinConditionParams.Blocks").stream().map(Material::valueOf).collect(Collectors.toSet()));
|
||||
TechKoTime = config.getInt("WinConditionParams.TechKoTime", 90);
|
||||
|
||||
EnterStages = Collections.unmodifiableList(config.getIntegerList("EnterStages"));
|
||||
AllowMissiles = config.getBoolean("Arena.AllowMissiles", !EnterStages.isEmpty());
|
||||
|
||||
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 = Material.getMaterial(config.getString("Techhider.ObfuscateWith", "end_stone").toUpperCase());
|
||||
HiddenBlocks = config.getStringList("Techhider.HiddenBlocks").stream().map(String::toUpperCase).map(Material::getMaterial).collect(Collectors.toSet());
|
||||
HiddenBlockEntities = Collections.unmodifiableSet(new HashSet<>(config.getStringList("Techhider.HiddenBlockEntities")));
|
||||
|
||||
if(schemsizeX < 0){
|
||||
schemsizeX = -schemsizeX;
|
||||
blueCornerX = blueCornerX - schemsizeX;
|
||||
}
|
||||
if(schemsizeY < 0){
|
||||
schemsizeY = -schemsizeY;
|
||||
blueCornerY = blueCornerY - schemsizeY;
|
||||
}
|
||||
if(schemsizeZ < 0){
|
||||
schemsizeZ = -schemsizeZ;
|
||||
blueCornerZ = blueCornerZ - schemsizeZ;
|
||||
}
|
||||
|
||||
BlueToRedX = worldconfig.getInt("BlueToRed.x", 0);
|
||||
BlueToRedY = worldconfig.getInt("BlueToRed.y", 0);
|
||||
BlueToRedZ = worldconfig.getInt("BlueToRed.z", schemsizeZ + 50);
|
||||
double teamBlueSpawnOffsetX = config.getDouble("Arena.SpawnOffset.x", 0);
|
||||
double teamBlueSpawnOffsetY = config.getDouble("Arena.SpawnOffset.y", schemsizeY);
|
||||
double teamBlueSpawnOffsetZ = config.getDouble("Arena.SpawnOffset.z", 0);
|
||||
BlueToRedZ = worldconfig.getInt("BlueToRed.z", GameModeConfig.Schematic.Size.z + 50);
|
||||
|
||||
int teamRedCornerX = BlueToRedX + blueCornerX;
|
||||
int teamRedCornerY = BlueToRedY + blueCornerY;
|
||||
int teamRedCornerZ = BlueToRedZ + blueCornerZ;
|
||||
|
||||
int teamBluePasteX = blueCornerX + schemsizeX / 2;
|
||||
int teamBluePasteZ = blueCornerZ + schemsizeZ / 2;
|
||||
int teamBluePasteX = blueCornerX + GameModeConfig.Schematic.Size.x / 2;
|
||||
int teamBluePasteZ = blueCornerZ + GameModeConfig.Schematic.Size.z / 2;
|
||||
int teamRedPasteX = teamBluePasteX + BlueToRedX;
|
||||
int teamRedPasteZ = teamBluePasteZ + BlueToRedZ;
|
||||
|
||||
TeamBlueSpawn = new Location(world,
|
||||
teamBluePasteX + 0.5 + teamBlueSpawnOffsetX,
|
||||
blueCornerY + 0.5 + teamBlueSpawnOffsetY,
|
||||
teamBluePasteZ + 0.5 + teamBlueSpawnOffsetZ);
|
||||
teamBluePasteX + 0.5 + GameModeConfig.Arena.SpawnOffset.x,
|
||||
blueCornerY + 0.5 + GameModeConfig.Arena.SpawnOffset.y,
|
||||
teamBluePasteZ + 0.5 + GameModeConfig.Arena.SpawnOffset.z);
|
||||
|
||||
TeamRedSpawn = new Location(world,
|
||||
teamRedPasteX + 0.5 - teamBlueSpawnOffsetX,
|
||||
teamRedCornerY + 0.5 + teamBlueSpawnOffsetY,
|
||||
teamRedPasteZ + 0.5 - teamBlueSpawnOffsetZ);
|
||||
teamRedPasteX + 0.5 - GameModeConfig.Arena.SpawnOffset.x,
|
||||
teamRedCornerY + 0.5 + GameModeConfig.Arena.SpawnOffset.y,
|
||||
teamRedPasteZ + 0.5 - GameModeConfig.Arena.SpawnOffset.z);
|
||||
|
||||
SpecSpawn = new Location(world,
|
||||
teamBluePasteX + BlueToRedX /2.0,
|
||||
blueCornerY + BlueToRedY /2.0 + schemsizeY/2.0,
|
||||
blueCornerY + BlueToRedY /2.0 + GameModeConfig.Schematic.Size.y/2.0,
|
||||
teamBluePasteZ + BlueToRedZ /2.0);
|
||||
|
||||
Vector v1 = TeamBlueSpawn.toVector().subtract(TeamRedSpawn.toVector());
|
||||
@@ -288,45 +169,45 @@ public class Config {
|
||||
int arenaMinZ;
|
||||
int arenaMaxZ;
|
||||
if(BlueToRedX > 0){
|
||||
arenaMinX = blueCornerX - schem2BorderX;
|
||||
arenaMaxX = teamRedCornerX + schemsizeX + schem2BorderX;
|
||||
arenaMinX = blueCornerX - GameModeConfig.Arena.Schem2Border.x;
|
||||
arenaMaxX = teamRedCornerX + GameModeConfig.Schematic.Size.x + GameModeConfig.Arena.Schem2Border.x;
|
||||
teamRedRotate = true;
|
||||
teamBlueRotate = false;
|
||||
}else{
|
||||
arenaMinX = teamRedCornerX - schem2BorderX;
|
||||
arenaMaxX = blueCornerX + schemsizeX + schem2BorderX;
|
||||
arenaMinX = teamRedCornerX - GameModeConfig.Arena.Schem2Border.x;
|
||||
arenaMaxX = blueCornerX + GameModeConfig.Schematic.Size.x + GameModeConfig.Arena.Schem2Border.x;
|
||||
teamRedRotate = false;
|
||||
teamBlueRotate = true;
|
||||
}
|
||||
if(BlueToRedZ > 0){
|
||||
arenaMinZ = blueCornerZ - schem2BorderZ;
|
||||
arenaMaxZ = teamRedCornerZ + schemsizeZ + schem2BorderZ;
|
||||
arenaMinZ = blueCornerZ - GameModeConfig.Arena.Schem2Border.z;
|
||||
arenaMaxZ = teamRedCornerZ + GameModeConfig.Schematic.Size.z + GameModeConfig.Arena.Schem2Border.z;
|
||||
teamRedRotate = true;
|
||||
teamBlueRotate = false;
|
||||
}else{
|
||||
arenaMinZ = teamRedCornerZ - schem2BorderZ;
|
||||
arenaMaxZ = blueCornerZ + schemsizeZ + schem2BorderZ;
|
||||
arenaMinZ = teamRedCornerZ - GameModeConfig.Arena.Schem2Border.z;
|
||||
arenaMaxZ = blueCornerZ + GameModeConfig.Schematic.Size.z + GameModeConfig.Arena.Schem2Border.z;
|
||||
if(BlueToRedZ != 0){
|
||||
teamRedRotate = false;
|
||||
teamBlueRotate = true;
|
||||
}
|
||||
}
|
||||
if(!rotate){
|
||||
if(!GameModeConfig.Schematic.Rotate){
|
||||
teamRedRotate = false;
|
||||
teamBlueRotate = false;
|
||||
}
|
||||
RedRotate = teamRedRotate;
|
||||
BlueRotate = teamBlueRotate;
|
||||
|
||||
RedPasteRegion = Region.fromSize(teamRedCornerX, teamRedCornerY, teamRedCornerZ, schemsizeX, schemsizeY, schemsizeZ);
|
||||
BluePasteRegion = Region.fromSize(blueCornerX, blueCornerY, blueCornerZ, schemsizeX, schemsizeY, schemsizeZ);
|
||||
RedPasteRegion = Region.fromSize(teamRedCornerX, teamRedCornerY, teamRedCornerZ, GameModeConfig.Schematic.Size.x, GameModeConfig.Schematic.Size.y, GameModeConfig.Schematic.Size.z);
|
||||
BluePasteRegion = Region.fromSize(blueCornerX, blueCornerY, blueCornerZ, GameModeConfig.Schematic.Size.x, GameModeConfig.Schematic.Size.y, GameModeConfig.Schematic.Size.z);
|
||||
|
||||
RedExtendRegion = Region.withExtension(teamRedCornerX, teamRedCornerY, teamRedCornerZ, schemsizeX, schemsizeY, schemsizeZ, PreperationArea, PreperationArea, PreperationArea);
|
||||
BlueExtendRegion = Region.withExtension(blueCornerX, blueCornerY, blueCornerZ, schemsizeX, schemsizeY, schemsizeZ, PreperationArea, PreperationArea, PreperationArea);
|
||||
ArenaRegion = Region.withExtension(arenaMinX, blueCornerY, arenaMinZ, arenaMaxX - arenaMinX, schemsizeY, arenaMaxZ - arenaMinZ, 0, PreperationArea, 0);
|
||||
RedExtendRegion = Region.withExtension(teamRedCornerX, teamRedCornerY, teamRedCornerZ, GameModeConfig.Schematic.Size.x, GameModeConfig.Schematic.Size.y, GameModeConfig.Schematic.Size.z, GameModeConfig.Arena.BorderFromSchematic, GameModeConfig.Arena.BorderFromSchematic, GameModeConfig.Arena.BorderFromSchematic);
|
||||
BlueExtendRegion = Region.withExtension(blueCornerX, blueCornerY, blueCornerZ, GameModeConfig.Schematic.Size.x, GameModeConfig.Schematic.Size.y, GameModeConfig.Schematic.Size.z, GameModeConfig.Arena.BorderFromSchematic, GameModeConfig.Arena.BorderFromSchematic, GameModeConfig.Arena.BorderFromSchematic);
|
||||
ArenaRegion = Region.withExtension(arenaMinX, blueCornerY, arenaMinZ, arenaMaxX - arenaMinX, GameModeConfig.Schematic.Size.y, arenaMaxZ - arenaMinZ, 0, GameModeConfig.Arena.BorderFromSchematic, 0);
|
||||
PlayerRegion = new Region(arenaMinX, underBorder, arenaMinZ, arenaMaxX, world.getMaxHeight(), arenaMaxZ);
|
||||
|
||||
BlueInsetRegion = new Region(BluePasteRegion.getMinX() + schemInsetX, BluePasteRegion.getMinY() + schemInsetBottom, BluePasteRegion.getMinZ() + schemInsetZ, BluePasteRegion.getMaxX() - schemInsetX, BluePasteRegion.getMaxY() - schemInsetTop, BluePasteRegion.getMaxZ() - schemInsetZ);
|
||||
BlueInsetRegion = new Region(BluePasteRegion.getMinX() + GameModeConfig.Schematic.Inset.x, BluePasteRegion.getMinY() + GameModeConfig.Schematic.Inset.bottom, BluePasteRegion.getMinZ() + GameModeConfig.Schematic.Inset.z, BluePasteRegion.getMaxX() - GameModeConfig.Schematic.Inset.x, BluePasteRegion.getMaxY() - GameModeConfig.Schematic.Inset.top, BluePasteRegion.getMaxZ() - GameModeConfig.Schematic.Inset.z);
|
||||
|
||||
int eventKampfID = Integer.parseInt(System.getProperty("fightID", "0"));
|
||||
if(eventKampfID >= 1){
|
||||
@@ -368,11 +249,11 @@ public class Config {
|
||||
}
|
||||
}else{
|
||||
//No event
|
||||
TeamRedColor = config.getString("Red.Prefix", "§c");
|
||||
TeamBlueColor = config.getString("Blue.Prefix", "§9");
|
||||
TeamRedName = config.getString("Red.Name", "Rot");
|
||||
TeamBlueName = config.getString("Blue.Name", "Blau");
|
||||
OnlyPublicSchematics = config.getBoolean("Schematic.OnlyPublicSchematics", false);
|
||||
TeamRedColor = GameModeConfig.Red.Prefix;
|
||||
TeamBlueColor = GameModeConfig.Blue.Prefix;
|
||||
TeamRedName = GameModeConfig.Red.Name;
|
||||
TeamBlueName = GameModeConfig.Blue.Name;
|
||||
OnlyPublicSchematics = GameModeConfig.Schematic.OnlyPublicSchematics;
|
||||
EventTeamBlueID = 0;
|
||||
EventTeamRedID = 0;
|
||||
EventKampf = null;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DummyAI extends AI {
|
||||
|
||||
@Override
|
||||
public SchematicNode chooseSchematic() {
|
||||
List<SchematicNode> publics = SchematicNode.getAllSchematicsOfType(0, Config.SchematicType.toDB());
|
||||
List<SchematicNode> publics = SchematicNode.getAllSchematicsOfType(0, Config.GameModeConfig.Schematic.Type.toDB());
|
||||
return publics.get(random.nextInt(publics.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -149,8 +149,8 @@ public class Commands {
|
||||
return;
|
||||
|
||||
Kit k = null;
|
||||
if(Config.PersonalKits){
|
||||
PersonalKit kit = PersonalKit.get(SteamwarUser.get(p.getUniqueId()).getId(), Config.SchematicType.toDB(), kitName);
|
||||
if(Config.GameModeConfig.Kits.PersonalKits){
|
||||
PersonalKit kit = PersonalKit.get(SteamwarUser.get(p.getUniqueId()).getId(), Config.GameModeConfig.Schematic.Type.toDB(), kitName);
|
||||
if(kit != null){
|
||||
kit.setInUse();
|
||||
k = new Kit(kit);
|
||||
|
||||
@@ -152,8 +152,8 @@ public class GUI {
|
||||
|
||||
List<SWListInv.SWListEntry<Kit>> entries = new ArrayList<>();
|
||||
|
||||
if(Config.PersonalKits){
|
||||
List<PersonalKit> kits = PersonalKit.get(SteamwarUser.get(p.getUniqueId()).getId(), Config.SchematicType.toDB());
|
||||
if(Config.GameModeConfig.Kits.PersonalKits){
|
||||
List<PersonalKit> kits = PersonalKit.get(SteamwarUser.get(p.getUniqueId()).getId(), Config.GameModeConfig.Schematic.Type.toDB());
|
||||
kits.forEach(kit -> entries.add(new SWListInv.SWListEntry<>(new SWItem(Material.LEATHER_CHESTPLATE, "§e" + kit.getName(), new ArrayList<>(), kit.isInUse(), clickType -> {}), new Kit(kit))));
|
||||
}else{
|
||||
List<Kit> kitList = Kit.getAvailableKits(fightPlayer.isLeader());
|
||||
@@ -169,19 +169,19 @@ public class GUI {
|
||||
if(entries.isEmpty()) {
|
||||
inv.setItem(22, new SWItem(Material.BARRIER, msg.parse("KIT_NO_KITS", p)));
|
||||
}
|
||||
if(Config.PersonalKits){
|
||||
if(Config.GameModeConfig.Kits.PersonalKits){
|
||||
inv.setItem(48, Material.NETHER_STAR, msg.parse("KIT_CREATE", p), clickType -> {
|
||||
SWAnvilInv anvilInv = new SWAnvilInv(p, msg.parse("KITNAME_TITLE", p));
|
||||
anvilInv.setItem(Material.LEATHER_CHESTPLATE);
|
||||
anvilInv.setCallback(s -> {
|
||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
||||
if(PersonalKit.get(user.getId(), Config.SchematicType.toDB(), s) != null) {
|
||||
if(PersonalKit.get(user.getId(), Config.GameModeConfig.Schematic.Type.toDB(), s) != null) {
|
||||
msg.sendPrefixless("KITNAME_IN_USE", p, ChatMessageType.ACTION_BAR);
|
||||
p.closeInventory();
|
||||
return;
|
||||
}
|
||||
Kit prototype = Kit.getAvailableKits(Fight.getFightPlayer(p).isLeader()).get(0);
|
||||
PersonalKit kit = PersonalKit.create(user.getId(), Config.SchematicType.toDB(), s, prototype.getInventory(), prototype.getArmor());
|
||||
PersonalKit kit = PersonalKit.create(user.getId(), Config.GameModeConfig.Schematic.Type.toDB(), s, prototype.getInventory(), prototype.getArmor());
|
||||
PersonalKitCreator.openKitCreator(p, kit);
|
||||
});
|
||||
anvilInv.open();
|
||||
@@ -202,14 +202,14 @@ public class GUI {
|
||||
return;
|
||||
}
|
||||
|
||||
int invSize = (Config.SubTypes.size() + 1) * 9;
|
||||
SWInventory inv = new SWInventory(p, invSize, msg.parse("SCHEM_TITLE", p, Config.GameName));
|
||||
setupSchemTypeRow(p, inv, Config.SchematicType, 0);
|
||||
for (int i = 0; i < Config.SubTypes.size(); i++) {
|
||||
setupSchemTypeRow(p, inv, Config.SubTypes.get(i), i + 1);
|
||||
int invSize = (Config.GameModeConfig.Schematic.SubTypes.size() + 1) * 9;
|
||||
SWInventory inv = new SWInventory(p, invSize, msg.parse("SCHEM_TITLE", p, Config.GameModeConfig.GameName));
|
||||
setupSchemTypeRow(p, inv, Config.GameModeConfig.Schematic.Type, 0);
|
||||
for (int i = 0; i < Config.GameModeConfig.Schematic.SubTypes.size(); i++) {
|
||||
setupSchemTypeRow(p, inv, Config.GameModeConfig.Schematic.SubTypes.get(i), i + 1);
|
||||
}
|
||||
if (!Config.test() && SteamwarUser.get(p.getUniqueId()).hasPerm(UserPerm.TEAM)) {
|
||||
SchematicNode node = SchematicNode.getSchematicNode(-1, Config.GameName, (Integer) null);
|
||||
SchematicNode node = SchematicNode.getSchematicNode(-1, Config.GameModeConfig.GameName, (Integer) null);
|
||||
if (node != null) {
|
||||
inv.setItem(2, new SWItem(SWItem.getMaterial(node.getItem()), msg.parse("SCHEM_DIRT", p), click -> {
|
||||
schemSelect(p, node);
|
||||
|
||||
+2
-2
@@ -36,10 +36,10 @@ import java.util.List;
|
||||
public class EnternCountdown extends Countdown {
|
||||
|
||||
private static int calcTime(FightPlayer fp, Countdown countdown) {
|
||||
int time = Config.EnterStages.get(fp.getKit().getEnterStage());
|
||||
int time = Config.GameModeConfig.EnterStages.get(fp.getKit().getEnterStage());
|
||||
|
||||
if(countdown != null) {
|
||||
time -= Config.TimeoutTime - countdown.getTimeLeft();
|
||||
time -= Config.GameModeConfig.WinConditionParams.TimeoutTime - countdown.getTimeLeft();
|
||||
|
||||
if(time < 0)
|
||||
time = 0;
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import de.steamwar.linkage.Linked;
|
||||
public class EventSpectateCountdown extends Countdown {
|
||||
|
||||
public EventSpectateCountdown() {
|
||||
super(Config.SpectatorDuration, new Message("SHUTDOWN_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
super(Config.GameModeConfig.Times.SpectatorDuration, new Message("SHUTDOWN_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
new StateDependentCountdown(ArenaMode.NotRestartable.contains(Config.mode) && !Config.replayserver(), FightState.Spectate, this);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -31,9 +31,9 @@ import org.bukkit.Bukkit;
|
||||
public class NoPlayersOnlineCountdown extends Countdown {
|
||||
|
||||
public NoPlayersOnlineCountdown() {
|
||||
super(Config.NoPlayerOnlineDuration, new Message("SHUTDOWN_COUNTDOWN"), null, false);
|
||||
super(Config.GameModeConfig.Times.NoPlayersOnlineDuration, new Message("SHUTDOWN_COUNTDOWN"), null, false);
|
||||
|
||||
if (!Config.ArenaLeaveable)
|
||||
if (!Config.GameModeConfig.Arena.Leaveable)
|
||||
new StateDependentCountdown(ArenaMode.AntiReplay, FightState.PreLeaderSetup, this);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ import de.steamwar.linkage.Linked;
|
||||
public class PostSchemCountdown extends Countdown {
|
||||
|
||||
public PostSchemCountdown() {
|
||||
super(Config.SetupDuration, new Message("POST_SCHEM_COUNTDOWN"), null, false);
|
||||
if(Config.mode == ArenaMode.PREPARE && Config.UnlimitedPrepare)
|
||||
super(Config.GameModeConfig.Times.SetupDuration, new Message("POST_SCHEM_COUNTDOWN"), null, false);
|
||||
if(Config.mode == ArenaMode.PREPARE && Config.GameModeConfig.Schematic.UnlimitedPrepare)
|
||||
return;
|
||||
|
||||
new StateDependentCountdown(ArenaMode.SeriousFight, FightState.PostSchemSetup, this);
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import de.steamwar.linkage.Linked;
|
||||
public class PreRunningCountdown extends Countdown {
|
||||
|
||||
public PreRunningCountdown() {
|
||||
super(Config.PreFightDuration, new Message("PRE_RUNNING_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, true);
|
||||
super(Config.GameModeConfig.Times.PreFightDuration, new Message("PRE_RUNNING_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, true);
|
||||
new StateDependentCountdown(ArenaMode.AntiReplay, FightState.PreRunning, this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import de.steamwar.linkage.Linked;
|
||||
public class PreSchemCountdown extends Countdown {
|
||||
|
||||
public PreSchemCountdown() {
|
||||
super(Config.PreSchemPasteDuration, new Message("PRE_SCHEM_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
super(Config.GameModeConfig.Times.PreSchemPasteDuration, new Message("PRE_SCHEM_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
new StateDependentCountdown(ArenaMode.AntiReplay, FightState.PreSchemSetup, this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import de.steamwar.linkage.Linked;
|
||||
public class SpectateOverCountdown extends Countdown {
|
||||
|
||||
public SpectateOverCountdown() {
|
||||
super(Config.test() ? 3600 : Config.SpectatorDuration, new Message("SPECTATE_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
super(Config.test() ? 3600 : Config.GameModeConfig.Times.SpectatorDuration, new Message("SPECTATE_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
new StateDependentCountdown(ArenaMode.Restartable.contains(Config.mode) || Config.replayserver(), FightState.Spectate, this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class TimeOverCountdown extends Countdown {
|
||||
private final Runnable timeOver;
|
||||
|
||||
public TimeOverCountdown(Runnable timeOver) {
|
||||
super(Config.TimeoutTime, new Message("RUNNING_COUNTDOWN"), SWSound.BLOCK_NOTE_BASS, false);
|
||||
super(Config.GameModeConfig.WinConditionParams.TimeoutTime, new Message("RUNNING_COUNTDOWN"), SWSound.BLOCK_NOTE_BASS, false);
|
||||
this.timeOver = timeOver;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class Fight {
|
||||
if (Config.OnlyPublicSchematics) {
|
||||
return true;
|
||||
}
|
||||
if (Config.IgnorePublicOnly || ArenaMode.RankedEvent.contains(Config.mode)) {
|
||||
if (Config.GameModeConfig.Schematic.IgnorePublicOnly || ArenaMode.RankedEvent.contains(Config.mode)) {
|
||||
return false;
|
||||
}
|
||||
if (redTeam.getLeader() == null || blueTeam.getLeader() == null) {
|
||||
|
||||
@@ -53,9 +53,9 @@ public class FightPlayer {
|
||||
this.entity = entity;
|
||||
this.team = team;
|
||||
this.isOut = false;
|
||||
kit = Kit.getKitByName(Config.MemberDefault);
|
||||
if(Config.PersonalKits){
|
||||
PersonalKit personalKit = PersonalKit.getKitInUse(user.getId(), Config.SchematicType.toDB());
|
||||
kit = Kit.getKitByName(Config.GameModeConfig.Kits.MemberDefault);
|
||||
if(Config.GameModeConfig.Kits.PersonalKits){
|
||||
PersonalKit personalKit = PersonalKit.getKitInUse(user.getId(), Config.GameModeConfig.Schematic.Type.toDB());
|
||||
if(personalKit != null){
|
||||
kit = new Kit(personalKit);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class FightPlayer {
|
||||
}
|
||||
|
||||
public void startEnternCountdown(Countdown countdown) {
|
||||
if(Config.EnterStages.size() > kit.getEnterStage() && kit.getEnterStage() >= 0)
|
||||
if(Config.GameModeConfig.EnterStages.size() > kit.getEnterStage() && kit.getEnterStage() >= 0)
|
||||
enternCountdown = new EnternCountdown(this, countdown);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ public class FightSchematic extends StateDependent {
|
||||
return;
|
||||
|
||||
if(clipboard == null){
|
||||
List<SchematicNode> publics = SchematicNode.getAllSchematicsOfType(0, Config.SchematicType.toDB());
|
||||
List<SchematicNode> publics = SchematicNode.getAllSchematicsOfType(0, Config.GameModeConfig.Schematic.Type.toDB());
|
||||
if(publics.isEmpty()) {
|
||||
for (SchematicType type : Config.SubTypes) {
|
||||
for (SchematicType type : Config.GameModeConfig.Schematic.SubTypes) {
|
||||
publics = SchematicNode.getAllSchematicsOfType(0, type.toDB());
|
||||
if (!publics.isEmpty()) {
|
||||
break;
|
||||
@@ -133,7 +133,7 @@ public class FightSchematic extends StateDependent {
|
||||
|
||||
if(ArenaMode.AntiReplay.contains(Config.mode)) {
|
||||
boolean changeRotation = false;
|
||||
if (Config.ActiveWinconditions.contains(Winconditions.RANDOM_ROTATE)) {
|
||||
if (Config.GameModeConfig.WinConditions.contains(Winconditions.RANDOM_ROTATE)) {
|
||||
changeRotation = new Random().nextBoolean();
|
||||
usedRotate = rotate ^ changeRotation;
|
||||
}
|
||||
@@ -163,9 +163,9 @@ public class FightSchematic extends StateDependent {
|
||||
clipboard,
|
||||
new Location(Config.world, region.centerX(), region.getMinY(), region.centerZ()),
|
||||
new Vector(
|
||||
Config.PasteAligned && Config.BlueToRedX != 0 ? region.getSizeX()/2.0 - dims.getBlockX() : -dims.getBlockX()/2.0,
|
||||
Config.WaterDepth != 0 ? Config.WaterDepth - WorldeditWrapper.impl.getWaterDepth(clipboard) : 0,
|
||||
Config.PasteAligned && Config.BlueToRedZ != 0 ? region.getSizeZ()/2.0 - dims.getBlockZ() : -dims.getBlockZ()/2.0
|
||||
Config.GameModeConfig.Schematic.PasteAligned && Config.BlueToRedX != 0 ? region.getSizeX()/2.0 - dims.getBlockX() : -dims.getBlockX()/2.0,
|
||||
Config.GameModeConfig.Arena.WaterDepth != 0 ? Config.GameModeConfig.Arena.WaterDepth - WorldeditWrapper.impl.getWaterDepth(clipboard) : 0,
|
||||
Config.GameModeConfig.Schematic.PasteAligned && Config.BlueToRedZ != 0 ? region.getSizeZ()/2.0 - dims.getBlockZ() : -dims.getBlockZ()/2.0
|
||||
).add(new Vector(usedRotate ? 1 : 0, 0, usedRotate ? 1 : 0)),
|
||||
new AffineTransform().rotateY(usedRotate ? 180 : 0)
|
||||
);
|
||||
@@ -179,17 +179,17 @@ public class FightSchematic extends StateDependent {
|
||||
|
||||
@Override
|
||||
public void disable() {
|
||||
if(!Config.ReplaceObsidianBedrock || Config.mode == ArenaMode.PREPARE)
|
||||
if(!Config.GameModeConfig.Schematic.ReplaceObsidianBedrock || Config.mode == ArenaMode.PREPARE)
|
||||
return;
|
||||
|
||||
FreezeWorld freezer = null;
|
||||
if(!Config.ReplaceWithBlockupdates)
|
||||
if(!Config.GameModeConfig.Schematic.ReplaceWithBlockupdates)
|
||||
freezer = new FreezeWorld();
|
||||
|
||||
replaceSync(Material.OBSIDIAN, Material.TNT);
|
||||
replaceSync(Material.BEDROCK, Material.SLIME_BLOCK);
|
||||
|
||||
if(!Config.ReplaceWithBlockupdates)
|
||||
if(!Config.GameModeConfig.Schematic.ReplaceWithBlockupdates)
|
||||
freezer.disable();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ import java.util.function.Consumer;
|
||||
public class FightTeam {
|
||||
|
||||
private static void setKitButton(HotbarKit kit, boolean leader) {
|
||||
if (Kit.getAvailableKits(leader).size() > 1 || Config.PersonalKits)
|
||||
if (Kit.getAvailableKits(leader).size() > 1 || Config.GameModeConfig.Kits.PersonalKits)
|
||||
kit.setItem(1, "CHOOSE_KIT", new ItemBuilder(Material.LEATHER_CHESTPLATE).enchant().build(), player -> GUI.kitSelection(player, ""));
|
||||
else
|
||||
kit.setItem(1, null, null, null);
|
||||
@@ -144,7 +144,7 @@ public class FightTeam {
|
||||
WorldOfColorWrapper.impl.setTeamColor(team, color);
|
||||
BountifulWrapper.impl.setNametagVisibility(team);
|
||||
team.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
|
||||
if (!Config.ActiveWinconditions.contains(Winconditions.AMONG_US)) {
|
||||
if (!Config.GameModeConfig.WinConditions.contains(Winconditions.AMONG_US)) {
|
||||
team.setAllowFriendlyFire(false);
|
||||
}
|
||||
|
||||
@@ -357,10 +357,10 @@ public class FightTeam {
|
||||
if(!silent)
|
||||
FightUI.addSubtitle("UI_LEADER_JOINS", prefix, leader.getEntity().getName());
|
||||
|
||||
publicsOnly = SchematicNode.getAllAccessibleSchematicsOfType(leader.getUser().getId(), Config.SchematicType.toDB()).isEmpty();
|
||||
publicsOnly = SchematicNode.getAllAccessibleSchematicsOfType(leader.getUser().getId(), Config.GameModeConfig.Schematic.Type.toDB()).isEmpty();
|
||||
|
||||
if(!Config.PersonalKits)
|
||||
leader.setKit(Kit.getKitByName(Config.LeaderDefault));
|
||||
if(!Config.GameModeConfig.Kits.PersonalKits)
|
||||
leader.setKit(Kit.getKitByName(Config.GameModeConfig.Kits.LeaderDefault));
|
||||
|
||||
leader.ifPlayer(player -> {
|
||||
if(FightState.getFightState() != FightState.POST_SCHEM_SETUP)
|
||||
@@ -417,7 +417,7 @@ public class FightTeam {
|
||||
|
||||
public void setSchem(SchematicNode schematic, int revision){
|
||||
this.schematic.setSchematic(schematic, revision);
|
||||
broadcast("SCHEMATIC_CHOSEN", Config.GameName, schematic.getName());
|
||||
broadcast("SCHEMATIC_CHOSEN", Config.GameModeConfig.GameName, schematic.getName());
|
||||
}
|
||||
|
||||
public void setReady(boolean ready) {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FightWorld extends StateDependent {
|
||||
public static void resetWorld(){
|
||||
List<Entity> entities = new ArrayList<>();
|
||||
Recording.iterateOverEntities(Objects::nonNull, entity -> {
|
||||
if(entity.getType() != EntityType.PLAYER && (!Config.ArenaLeaveable || Config.ArenaRegion.inRegion(entity.getLocation())))
|
||||
if(entity.getType() != EntityType.PLAYER && (!Config.GameModeConfig.Arena.Leaveable || Config.ArenaRegion.inRegion(entity.getLocation())))
|
||||
entities.add(entity);
|
||||
});
|
||||
entities.forEach(Entity::remove);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class HotbarKit extends Kit {
|
||||
for(int i = 0; i < HOTBAR_SIZE; i++) {
|
||||
if(nameTags[i] != null) {
|
||||
ItemMeta meta = Objects.requireNonNull(getInventory()[i].getItemMeta());
|
||||
meta.setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameName));
|
||||
meta.setDisplayName(FightSystem.getMessage().parse(nameTags[i], player, Config.GameModeConfig.GameName));
|
||||
getInventory()[i].setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class Kit {
|
||||
private static final File kits = new File(FightSystem.getPlugin().getDataFolder(), Config.KitFile);
|
||||
private static final File kits = new File(FightSystem.getPlugin().getDataFolder(), Config.GameModeConfig.Kits.File);
|
||||
private static final ArrayList<Kit> loadedKits = new ArrayList<>();
|
||||
|
||||
protected static final Map<Player, Kit> activeKits = new HashMap<>();
|
||||
@@ -179,7 +179,7 @@ public class Kit {
|
||||
}
|
||||
|
||||
public void removeBadItems(){
|
||||
Kit normal = Kit.getKitByName(Config.MemberDefault);
|
||||
Kit normal = Kit.getKitByName(Config.GameModeConfig.Kits.MemberDefault);
|
||||
assert normal != null;
|
||||
|
||||
for(int i = 0; i < inventory.length; i++){
|
||||
@@ -194,7 +194,7 @@ public class Kit {
|
||||
return false;
|
||||
|
||||
//Check for forbidden item
|
||||
if(Config.ForbiddenItems.contains(stack.getType()))
|
||||
if(Config.GameModeConfig.Kits.ForbiddenItems.contains(stack.getType()))
|
||||
return true;
|
||||
|
||||
//Check for attribute modifiers
|
||||
@@ -211,7 +211,7 @@ public class Kit {
|
||||
return true; //Blocks prefilled inventories
|
||||
}
|
||||
|
||||
Kit normal = Kit.getKitByName(Config.MemberDefault);
|
||||
Kit normal = Kit.getKitByName(Config.GameModeConfig.Kits.MemberDefault);
|
||||
assert normal != null;
|
||||
return !normal.isEnchantmentInKit(stack) && !stack.getEnchantments().isEmpty();
|
||||
}
|
||||
@@ -303,8 +303,8 @@ public class Kit {
|
||||
}
|
||||
|
||||
inv.setCallback(-999, click -> player.closeInventory());
|
||||
if(Config.PersonalKits){
|
||||
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), FightSystem.getMessage().parse("KIT_PREVIEW_EDIT", player), clickType -> PersonalKitCreator.openKitCreator(player, PersonalKit.get(SteamwarUser.get(player.getUniqueId()).getId(), Config.SchematicType.toDB(), name)));
|
||||
if(Config.GameModeConfig.Kits.PersonalKits){
|
||||
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), FightSystem.getMessage().parse("KIT_PREVIEW_EDIT", player), clickType -> PersonalKitCreator.openKitCreator(player, PersonalKit.get(SteamwarUser.get(player.getUniqueId()).getId(), Config.GameModeConfig.Schematic.Type.toDB(), name)));
|
||||
inv.setItem(53, Material.BARRIER, FightSystem.getMessage().parse("KIT_PREVIEW_DELETE", player), clickType -> {
|
||||
player.closeInventory();
|
||||
SWInventory conf = new SWInventory(player, 9, FightSystem.getMessage().parse("KIT_DELETION_CONFIRMATION", player));
|
||||
@@ -312,9 +312,9 @@ public class Kit {
|
||||
conf.setItem(0, SWItem.getDye(10), FightSystem.getMessage().parse("KIT_DELETION_DELETE", player), click -> {
|
||||
player.closeInventory();
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
PersonalKit kit = PersonalKit.get(user.getId(), Config.SchematicType.toDB(), name);
|
||||
PersonalKit kit = PersonalKit.get(user.getId(), Config.GameModeConfig.Schematic.Type.toDB(), name);
|
||||
if(kit.isInUse()) {
|
||||
List<PersonalKit> kits = PersonalKit.get(user.getId(), Config.SchematicType.toDB());
|
||||
List<PersonalKit> kits = PersonalKit.get(user.getId(), Config.GameModeConfig.Schematic.Type.toDB());
|
||||
if(!kits.isEmpty()){
|
||||
PersonalKit kit1 = kits.get(0);
|
||||
kit1.setInUse();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ArenaBorder implements Listener {
|
||||
public ArenaBorder() {
|
||||
new StateDependentListener(ArenaMode.All, FightState.All, this);
|
||||
new StateDependentTask(ArenaMode.All, FightState.Running, this::damage, 2, 2);
|
||||
new StateDependentListener(!Config.GroundWalkable, FightState.AntiRunning, new Listener() {
|
||||
new StateDependentListener(!Config.GameModeConfig.Arena.GroundWalkable, FightState.AntiRunning, new Listener() {
|
||||
@EventHandler
|
||||
public void onMove(PlayerMoveEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
@@ -102,7 +102,7 @@ public class ArenaBorder implements Listener {
|
||||
}
|
||||
|
||||
private void addToSpectator(Player player) {
|
||||
if(Config.ArenaLeaveable || !player.isOnline() || playerBorder.contains(player))
|
||||
if(Config.GameModeConfig.Arena.Leaveable || !player.isOnline() || playerBorder.contains(player))
|
||||
return;
|
||||
|
||||
spectatorBorder.addPlayer(player);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ArrowStopper {
|
||||
private static final BlockFace[] BLOCK_FACES = {BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH};
|
||||
|
||||
public ArrowStopper() {
|
||||
new StateDependentTask(Config.TechhiderActive, FightState.Running, this::run, 1, 1);
|
||||
new StateDependentTask(Config.GameModeConfig.Techhider.Active, FightState.Running, this::run, 1, 1);
|
||||
}
|
||||
|
||||
private static final Class<?> entityArrow = Reflection.getClass("net.minecraft.world.entity.projectile.AbstractArrow");
|
||||
@@ -87,7 +87,7 @@ public class ArrowStopper {
|
||||
}
|
||||
|
||||
private boolean checkBlock(Block block) {
|
||||
return Config.HiddenBlocks.contains(block.getType());
|
||||
return Config.GameModeConfig.Techhider.HiddenBlocks.contains(block.getType());
|
||||
}
|
||||
|
||||
private boolean invalidEntity(Projectile entity) {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.bukkit.event.block.BlockFadeEvent;
|
||||
public class BlockFadeListener implements Listener {
|
||||
|
||||
public BlockFadeListener() {
|
||||
new StateDependentListener(Config.DisableSnowMelt, FightState.All, this);
|
||||
new StateDependentListener(Config.GameModeConfig.Arena.DisableSnowMelt, FightState.All, this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -51,7 +51,7 @@ public class Chat implements Listener {
|
||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
||||
if(fightTeam != null) {
|
||||
String teamName = fightTeam.getColoredName();
|
||||
if(message.startsWith(Config.TeamChatDetection)) {
|
||||
if(message.startsWith(Config.GameModeConfig.TeamChatPrefix)) {
|
||||
fightTeam.broadcastChat(player, message.substring(1));
|
||||
} else {
|
||||
broadcastChat("PARTICIPANT_CHAT", teamName, player.getName(), message);
|
||||
|
||||
+2
-2
@@ -82,13 +82,13 @@ public class DenyWorldInteraction implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handleEntityExplode(EntityExplodeEvent event) {
|
||||
if(!Config.ArenaLeaveable || Config.ArenaRegion.inRegion(event.getLocation()))
|
||||
if(!Config.GameModeConfig.Arena.Leaveable || Config.ArenaRegion.inRegion(event.getLocation()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void handleBlockBurn(BlockIgniteEvent event) {
|
||||
if(!Config.ArenaLeaveable || Config.ArenaRegion.inRegion(event.getBlock()))
|
||||
if(!Config.GameModeConfig.Arena.Leaveable || Config.ArenaRegion.inRegion(event.getBlock()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import java.util.Objects;
|
||||
public class InFightDamage implements Listener {
|
||||
|
||||
public InFightDamage() {
|
||||
new StateDependentListener(!Config.ActiveWinconditions.contains(Winconditions.AMONG_US), FightState.Running, this);
|
||||
new StateDependentListener(!Config.GameModeConfig.WinConditions.contains(Winconditions.AMONG_US), FightState.Running, this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class JoinRequestListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
FightPlayer fp = Fight.getFightPlayer(player);
|
||||
|
||||
if (!Config.ArenaLeaveable && (fp == null || !fp.isLiving())) {
|
||||
if (!Config.GameModeConfig.Arena.Leaveable && (fp == null || !fp.isLiving())) {
|
||||
HotbarKit.SPECTATOR_KIT.loadToPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class LeaveableArena implements Listener {
|
||||
private final Map<Player, GameMode> spectatorsInArena = new HashMap<>();
|
||||
|
||||
public LeaveableArena() {
|
||||
new StateDependentListener(Config.ArenaLeaveable, FightState.All, this);
|
||||
new StateDependentListener(Config.GameModeConfig.Arena.Leaveable, FightState.All, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
||||
@@ -99,7 +99,7 @@ public class Permanent implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
FightPlayer fp = Fight.getFightPlayer(player);
|
||||
|
||||
if (!Config.ArenaLeaveable && fp == null) {
|
||||
if (!Config.GameModeConfig.Arena.Leaveable && fp == null) {
|
||||
player.setGameMode(GameMode.SPECTATOR);
|
||||
spectatorTeam.addEntry(player.getName());
|
||||
player.teleport(Config.SpecSpawn);
|
||||
@@ -111,13 +111,13 @@ public class Permanent implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void handlePlayerDeath(PlayerDeathEvent event) {
|
||||
if(!Config.ArenaLeaveable || Fight.fighting(event.getEntity()))
|
||||
if(!Config.GameModeConfig.Arena.Leaveable || Fight.fighting(event.getEntity()))
|
||||
event.setDeathMessage(null);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void handlePlayerLeave(PlayerQuitEvent event) {
|
||||
if(!Config.ArenaLeaveable)
|
||||
if(!Config.GameModeConfig.Arena.Leaveable)
|
||||
event.setQuitMessage(null);
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ public class Permanent implements Listener {
|
||||
Player player = e.getPlayer();
|
||||
|
||||
ItemStack stack = e.getItem().getItemStack();
|
||||
if(Config.PersonalKits) {
|
||||
if(Config.ForbiddenItems.contains(stack.getType())) {
|
||||
if(Config.GameModeConfig.Kits.PersonalKits) {
|
||||
if(Config.GameModeConfig.Kits.ForbiddenItems.contains(stack.getType())) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
} else {
|
||||
@@ -192,7 +192,7 @@ public class Permanent implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onWorldLoad(WorldLoadEvent e) {
|
||||
if(!Config.ArenaLeaveable)
|
||||
if(!Config.GameModeConfig.Arena.Leaveable)
|
||||
e.getWorld().setAutoSave(false);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class PersonalKitCreator implements Listener {
|
||||
private static final Map<HumanEntity, InventoryBackup> openKitCreators = new HashMap<>();
|
||||
|
||||
public PersonalKitCreator(){
|
||||
new StateDependentListener(Config.PersonalKits, FightState.Setup, this);
|
||||
new StateDependentListener(Config.GameModeConfig.Kits.PersonalKits, FightState.Setup, this);
|
||||
}
|
||||
|
||||
public static void openKitCreator(Player player, PersonalKit kit){
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ public class PistonListener implements Listener {
|
||||
return;
|
||||
|
||||
//Wenn Entern aktiv ist, sollen Raketen etc. entern können
|
||||
new StateDependentListener(!Config.AllowMissiles, FightState.All, this);
|
||||
new StateDependentListener(Config.AllowMissiles, FightState.Setup, this);
|
||||
new StateDependentListener(!Config.GameModeConfig.Arena.AllowMissiles, FightState.All, this);
|
||||
new StateDependentListener(Config.GameModeConfig.Arena.AllowMissiles, FightState.Setup, this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -85,7 +85,7 @@ public class PrepareSchem implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
schem.setSchemtype(Config.SchematicType.checkType());
|
||||
schem.setSchemtype(Config.GameModeConfig.Schematic.Type.checkType());
|
||||
schem.setPrepared(true);
|
||||
|
||||
try{
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Shutdown implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handlePlayerQuit(PlayerQuitEvent event) {
|
||||
if(Config.replayserver() || Config.ArenaLeaveable)
|
||||
if(Config.replayserver() || Config.GameModeConfig.Arena.Leaveable)
|
||||
return;
|
||||
|
||||
//Shutdown server if nobody online
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.Map;
|
||||
@Linked
|
||||
public class WaterRemover implements Listener {
|
||||
|
||||
private static final int MIN_Y = Config.BluePasteRegion.getMinY() + Config.WaterDepth;
|
||||
private static final int MIN_Y = Config.BluePasteRegion.getMinY() + Config.GameModeConfig.Arena.WaterDepth;
|
||||
|
||||
private final Map<Integer, FightTeam> tnt = new HashMap<>();
|
||||
|
||||
|
||||
+2
-2
@@ -90,8 +90,8 @@ public class PacketProcessor implements Listener {
|
||||
private final PacketSource source;
|
||||
private final BukkitTask task;
|
||||
private final LinkedList<Runnable> syncList = new LinkedList<>();
|
||||
private final Set<Integer> hiddenBlockIds = Config.HiddenBlocks.stream().flatMap(m -> BlockIds.impl.materialToAllIds(m).stream()).collect(Collectors.toSet());
|
||||
private final int obfuscateWith = BlockIds.impl.materialToId(Config.ObfuscateWith);
|
||||
private final Set<Integer> hiddenBlockIds = Config.GameModeConfig.Techhider.HiddenBlocks.stream().flatMap(m -> BlockIds.impl.materialToAllIds(m).stream()).collect(Collectors.toSet());
|
||||
private final int obfuscateWith = BlockIds.impl.materialToId(Config.GameModeConfig.Techhider.ObfuscateWith);
|
||||
private final FreezeWorld freezer = new FreezeWorld();
|
||||
private final REntityServer entityServer = new REntityServer();
|
||||
private final Map<Integer, REntity> entities = new HashMap<>();
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class OneShotStateDependent extends StateDependent{
|
||||
}
|
||||
|
||||
public OneShotStateDependent(Winconditions wincondition, Set<FightState> states, Runnable runnable) {
|
||||
super(Config.ActiveWinconditions.contains(wincondition), states);
|
||||
super(Config.GameModeConfig.WinConditions.contains(wincondition), states);
|
||||
this.runnable = runnable;
|
||||
register();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public abstract class StateDependent implements IStateDependent {
|
||||
private final boolean register;
|
||||
|
||||
protected StateDependent(Winconditions wincondition, Set<FightState> states){
|
||||
this(Config.ActiveWinconditions.contains(wincondition), states);
|
||||
this(Config.GameModeConfig.WinConditions.contains(wincondition), states);
|
||||
}
|
||||
|
||||
protected StateDependent(Set<ArenaMode> mode, Set<FightState> states){
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class StateDependentCountdown extends StateDependent {
|
||||
}
|
||||
|
||||
public StateDependentCountdown(Winconditions wincondition, Set<FightState> states, Countdown countdown) {
|
||||
this(Config.ActiveWinconditions.contains(wincondition), states, countdown);
|
||||
this(Config.GameModeConfig.WinConditions.contains(wincondition), states, countdown);
|
||||
}
|
||||
|
||||
public StateDependentCountdown(boolean active, Set<FightState> states, Countdown countdown) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class StateDependentListener extends StateDependent{
|
||||
private final Listener listener;
|
||||
|
||||
public StateDependentListener(Winconditions wincondition, Set<FightState> states, Listener listener){
|
||||
super(Config.ActiveWinconditions.contains(wincondition), states);
|
||||
super(Config.GameModeConfig.WinConditions.contains(wincondition), states);
|
||||
this.listener = listener;
|
||||
register();
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class StateDependentTask extends StateDependent {
|
||||
private BukkitTask task = null;
|
||||
|
||||
public StateDependentTask(Winconditions wincondition, Set<FightState> states, Runnable runnable, long delay, long period){
|
||||
this(Config.ActiveWinconditions.contains(wincondition), states, runnable, delay, period);
|
||||
this(Config.GameModeConfig.WinConditions.contains(wincondition), states, runnable, delay, period);
|
||||
}
|
||||
|
||||
public StateDependentTask(boolean enabled, Set<FightState> states, Runnable runnable, long delay, long period){
|
||||
|
||||
@@ -43,7 +43,7 @@ public class BungeeFightInfo {
|
||||
private void send() {
|
||||
NetworkSender.send(new FightInfoPacket(
|
||||
Config.world.getName(),
|
||||
Config.SchematicType.toDB(),
|
||||
Config.GameModeConfig.Schematic.Type.toDB(),
|
||||
"",
|
||||
Fight.getBlueTeam().getColoredName(),
|
||||
Fight.getRedTeam().getColoredName(),
|
||||
|
||||
@@ -94,7 +94,7 @@ public class FightStatistics {
|
||||
private void disable() {
|
||||
FightTeam winner = FightSystem.getLastWinner();
|
||||
String windescription = FightSystem.getLastWinreason();
|
||||
String gameMode = Config.SchematicType.toDB();
|
||||
String gameMode = Config.GameModeConfig.Schematic.Type.toDB();
|
||||
Instant endTime = Instant.now();
|
||||
|
||||
int blueLeader = getLeader(Fight.getBlueTeam());
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Hull {
|
||||
private static final IntVector[] NO_BRANCHES = new IntVector[0];
|
||||
|
||||
private static boolean isOccluding(Material material) {
|
||||
return material.isOccluding() || Config.HiddenBlocks.contains(material);
|
||||
return material.isOccluding() || Config.GameModeConfig.Techhider.HiddenBlocks.contains(material);
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class TechHiderWrapper extends StateDependent implements TechHider.LocationEvaluator, Listener {
|
||||
|
||||
public static final boolean ENABLED = !Config.OnlyPublicSchematics && !Config.test() && Config.TechhiderActive;
|
||||
public static final boolean ENABLED = !Config.OnlyPublicSchematics && !Config.test() && Config.GameModeConfig.Techhider.Active;
|
||||
|
||||
@Getter
|
||||
private final ConcurrentHashMap<Player, Region> hiddenRegion = new ConcurrentHashMap<>();
|
||||
@@ -60,7 +60,7 @@ public class TechHiderWrapper extends StateDependent implements TechHider.Locati
|
||||
|
||||
public TechHiderWrapper() {
|
||||
super(ENABLED, FightState.Schem);
|
||||
techHider = new TechHider(this, Config.ObfuscateWith, Config.HiddenBlocks, Config.HiddenBlockEntities);
|
||||
techHider = new TechHider(this, Config.GameModeConfig.Techhider.ObfuscateWith, Config.GameModeConfig.Techhider.HiddenBlocks, Config.GameModeConfig.Techhider.HiddenBlockEntities);
|
||||
|
||||
try {
|
||||
key = new SecretKeySpec(Files.readAllBytes(new File(System.getProperty("user.home"), "hullhider.key").toPath()), "AES");
|
||||
|
||||
+6
-6
@@ -40,7 +40,7 @@ public abstract class WinconditionBasePercent extends Wincondition implements Pr
|
||||
private final Map<FightTeam, TeamPercent> teamMap = new HashMap<>();
|
||||
|
||||
protected Consumer<FightTeam> checkWin = team -> {
|
||||
if (getPercent(team) >= Config.PercentWin) {
|
||||
if (getPercent(team) >= Config.GameModeConfig.WinConditionParams.PercentWin) {
|
||||
win(Fight.getOpposite(team), "WIN_PERCENT", team.getColoredName());
|
||||
}
|
||||
};
|
||||
@@ -49,7 +49,7 @@ public abstract class WinconditionBasePercent extends Wincondition implements Pr
|
||||
public WinconditionBasePercent(Winconditions wincondition, String windescription) {
|
||||
super(windescription);
|
||||
|
||||
if (Config.ActiveWinconditions.contains(wincondition)) {
|
||||
if (Config.GameModeConfig.WinConditions.contains(wincondition)) {
|
||||
printableWinconditions.add(this);
|
||||
percentWincondition = this;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public abstract class WinconditionBasePercent extends Wincondition implements Pr
|
||||
}
|
||||
|
||||
public Message getDisplay(FightTeam team) {
|
||||
return new Message("BAR_PERCENT", team.getPrefix() + (Math.round(10000.0 * (1.0 - getPercent(team) / Config.PercentWin)) / 100.0));
|
||||
return new Message("BAR_PERCENT", team.getPrefix() + (Math.round(10000.0 * (1.0 - getPercent(team) / Config.GameModeConfig.WinConditionParams.PercentWin)) / 100.0));
|
||||
}
|
||||
|
||||
public double getPercent(FightTeam team) {
|
||||
@@ -93,13 +93,13 @@ public abstract class WinconditionBasePercent extends Wincondition implements Pr
|
||||
if (
|
||||
event.getEntityType() == EntityType.FIREBALL ||
|
||||
!team.getExtendRegion().inRegion(event.getEntity().getLocation()) ||
|
||||
(!Config.PercentEntern && !Config.EnterStages.isEmpty() && Config.EnterStages.get(0) >= Wincondition.getTimeOverCountdown().getTimeLeft())
|
||||
(!Config.GameModeConfig.WinConditionParams.PercentEntern && !Config.GameModeConfig.EnterStages.isEmpty() && Config.GameModeConfig.EnterStages.get(0) >= Wincondition.getTimeOverCountdown().getTimeLeft())
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.blockList().forEach(block -> {
|
||||
if (countAnyBlock || Config.PercentBlocks.contains(block.getType()) == Config.PercentBlocksWhitelist) {
|
||||
if (countAnyBlock || Config.GameModeConfig.WinConditionParams.Blocks.contains(block.getType()) == Config.GameModeConfig.WinConditionParams.BlocksWhitelist) {
|
||||
currentBlocks--;
|
||||
}
|
||||
});
|
||||
@@ -111,7 +111,7 @@ public abstract class WinconditionBasePercent extends Wincondition implements Pr
|
||||
totalBlocks = 0;
|
||||
countAnyBlock = false;
|
||||
team.getSchemRegion().forEach((x, y, z) -> {
|
||||
if (Config.PercentBlocks.contains(Config.world.getBlockAt(x, y, z).getType()) == Config.PercentBlocksWhitelist)
|
||||
if (Config.GameModeConfig.WinConditionParams.Blocks.contains(Config.world.getBlockAt(x, y, z).getType()) == Config.GameModeConfig.WinConditionParams.BlocksWhitelist)
|
||||
totalBlocks++;
|
||||
});
|
||||
// Edge Case for DirtBlock
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public abstract class WinconditionBlocks extends Wincondition implements Printab
|
||||
}
|
||||
};
|
||||
|
||||
if(Config.ActiveWinconditions.contains(wincondition))
|
||||
if(Config.GameModeConfig.WinConditions.contains(wincondition))
|
||||
printableWinconditions.add(this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public abstract class WinconditionComparisonTimeout extends Wincondition {
|
||||
|
||||
public WinconditionComparisonTimeout(Winconditions wincondition, String windescription, String winMessage, ToDoubleFunction<FightTeam> evaluate) {
|
||||
super(windescription);
|
||||
if(Config.ActiveWinconditions.contains(wincondition)) {
|
||||
if(Config.GameModeConfig.WinConditions.contains(wincondition)) {
|
||||
timeOverCountdown = new StateDependentCountdown(wincondition, FightState.Running, new TimeOverCountdown(() -> comparisonWin(evaluate, winMessage, "WIN_TIME_OVER")));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class WinconditionPoints extends WinconditionBasePercent implements Liste
|
||||
|
||||
new StateDependentListener(Winconditions.POINTS, FightState.Ingame, this);
|
||||
|
||||
if(Config.ActiveWinconditions.contains(Winconditions.POINTS)){
|
||||
if(Config.GameModeConfig.WinConditions.contains(Winconditions.POINTS)){
|
||||
timeOverCountdown = new StateDependentCountdown(Winconditions.POINTS, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import java.util.Map;
|
||||
@Linked
|
||||
public class WinconditionTimeTechKO extends Wincondition implements Listener {
|
||||
|
||||
private static final int TECH_KO_HALF_TIME = Config.TechKoTime/2;
|
||||
private static final int TECH_KO_HALF_TIME = Config.GameModeConfig.WinConditionParams.TechKoTime/2;
|
||||
|
||||
private final Map<Integer, FightTeam> spawnLocations = new HashMap<>();
|
||||
private final Map<FightTeam, TechKOCountdown> countdowns = new HashMap<>();
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class WinconditionTimedDamageTechKO extends Wincondition implements Print
|
||||
@Override
|
||||
public void enable() {
|
||||
Fight.teams().forEach(team -> {
|
||||
TechKOCountdown countdown = new TechKOCountdown(team, Config.TechKoTime);
|
||||
TechKOCountdown countdown = new TechKOCountdown(team, Config.GameModeConfig.WinConditionParams.TechKoTime);
|
||||
countdowns.put(team, countdown);
|
||||
countdown.enable();
|
||||
});
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class WinconditionTimeout extends Wincondition {
|
||||
|
||||
public WinconditionTimeout() {
|
||||
super("Timeout");
|
||||
if(Config.ActiveWinconditions.contains(Winconditions.TIMEOUT)){
|
||||
if(Config.GameModeConfig.WinConditions.contains(Winconditions.TIMEOUT)){
|
||||
timeOverCountdown = new StateDependentCountdown(Winconditions.TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user