From 776b0b1f9f6965b44200204a3e1ff43928205283 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Wed, 20 May 2026 22:53:34 +0200 Subject: [PATCH 1/8] fix: allow ISE in team prefix command for improved flexibility --- .../src/de/steamwar/velocitycore/commands/TeamCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java index ef46d9b0..502694bd 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java @@ -366,7 +366,7 @@ public class TeamCommand extends SWCommand { } @Register(value = "prefix", description = "TEAM_PREFIX_USAGE") - public void prefix(@Validator("canUseTeamPrefix") Chatter sender, @StaticValue(value = {SW, STEAM_WAR, "Team"}, falseValues = {2}) boolean useSWTeamTag) { + public void prefix(@Validator("canUseTeamPrefix") Chatter sender, @StaticValue(value = {SW, STEAM_WAR, "Team"}, falseValues = {2}, allowISE = true) boolean useSWTeamTag) { SteamwarPrefix.setSWPrefix(sender.user(), useSWTeamTag); sender.system("TEAM_PREFIX_SET", useSWTeamTag ? STEAM_WAR : sender.parse("TEAM_PREFIX_TEAM")); } From 71108651fc067cbc46ec6c0465cc86244aae6014 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Wed, 2 Sep 2026 00:10:03 +0200 Subject: [PATCH 2/8] add toggle for per region Wind Charge limit and blocker for leaving the region --- .../src/de/steamwar/sql/GameModeConfig.java | 16 ++++++ FightSystem/FightSystem_Core/src/config.yml | 4 ++ .../listener/WindchargeStopper.java | 56 ++++++++++++++++--- 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index 17bfccb5..82d07ef5 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -509,6 +509,20 @@ public final class GameModeConfig { */ public final boolean WindchargesDestroyWater; + /** + * Allows Wind Charges to leave the Region. + * + * @implSpec {@code true} by default + */ + public final boolean WindchargesCanLeaveRegion; + + /** + * Limits the amount of Wind Charges in each extended region. -1 is no limit + * + * @implSpec {@code -1} by default + */ + public final int WindchargeLimit; + private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List EnterStages) { loaded = loader.canLoad(); WaterDepth = loader.getInt("WaterDepth", 0); @@ -529,6 +543,8 @@ public final class GameModeConfig { WindchargesCanCrossMiddle = loader.getBoolean("WindchargesCanCrossMiddle", false); WindchargesInteractWithBlocks = loader.getBoolean("WindchargesInteractWithBlocks", true); WindchargesDestroyWater = loader.getBoolean("WindchargesDestroyWater", false); + WindchargesCanLeaveRegion = loader.getBoolean("WindchargesCanLeaveRegion", true); + WindchargeLimit = loader.getInt("WindchargeLimit", -1); } @ToString diff --git a/FightSystem/FightSystem_Core/src/config.yml b/FightSystem/FightSystem_Core/src/config.yml index dbaf3c33..756f4c2a 100644 --- a/FightSystem/FightSystem_Core/src/config.yml +++ b/FightSystem/FightSystem_Core/src/config.yml @@ -68,6 +68,10 @@ Arena: WindchargesCanCrossMiddle: false # defaults to false if missing # Allows Wind Charge interaction with Blocks. WindchargesInteractWithBlocks: false # defaults to false if missing + # Allows Wind Charges to leave the extended region. + WindchargesCanLeaveRegion: true # defaults to true + # Limits the amount of Wind Charges in each extended region. -1 is no limit + WindchargeLimit: -1 # defaults to -1 Schematic: # The size of the schematics diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java index a750a1b9..d81cd7a9 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java @@ -22,31 +22,71 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentTask; +import de.steamwar.fightsystem.utils.Region; import de.steamwar.linkage.Linked; import net.minecraft.world.entity.projectile.windcharge.WindCharge; import org.bukkit.Location; @Linked public class WindchargeStopper { - public WindchargeStopper() { - new StateDependentTask(!Config.GameModeConfig.Arena.WindchargesCanCrossMiddle, FightState.Running, this::run, 1, 1); + canCrossMiddle = Config.GameModeConfig.Arena.WindchargesCanCrossMiddle; + canLeaveRegion = Config.GameModeConfig.Arena.WindchargesCanLeaveRegion; + limit = Config.GameModeConfig.Arena.WindchargeLimit; + + boolean enabled = limit >= 0 || !canCrossMiddle || !canLeaveRegion; + + new StateDependentTask(enabled, FightState.Running, this::run, 1, 1); } private static final int middleLine = Config.SpecSpawn.getBlockZ(); - private static final Class windChargeClass = WindCharge.class; + private final boolean canCrossMiddle; + private final boolean canLeaveRegion; + private final int limit; + + private int blueCount; + private int redCount; + private void run() { + redCount = 0; + blueCount = 0; + Recording.iterateOverEntities(windChargeClass::isInstance, entity -> { - Location nextlocation = entity.getLocation().add(entity.getVelocity()); Location location = entity.getLocation(); + Location nextlocation = location.clone().add(entity.getVelocity()); - boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || - nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; + if (!canCrossMiddle) { + boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || + nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; + if (passedMiddle) { + entity.remove(); + return; + } + } - if (passedMiddle) { - entity.remove(); + Region region = Config.BlueExtendRegion.inRegion(location) ? Config.BlueExtendRegion + : Config.RedExtendRegion.inRegion(location) ? Config.RedExtendRegion + : null; + + if (!canLeaveRegion) { + if (region == null) { + entity.remove(); + return; + } + if (!region.inRegion(nextlocation)) { + entity.remove(); + return; + } + } + + if (limit >= 0 && region != null) { + if (region == Config.BlueExtendRegion) { + if (++blueCount > limit) entity.remove(); + } else { + if (++redCount > limit) entity.remove(); + } } }); } From 99f94c527833d5bf6182081664fa01a7dd1609a1 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:00:38 +0200 Subject: [PATCH 3/8] Add arena map name to world identifier --- .../src/de/steamwar/fightsystem/FightSystem.java | 9 +++++++++ .../src/de/steamwar/velocitycore/ServerStarter.java | 1 + 2 files changed, 10 insertions(+) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index c676308e..5da7c23a 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -21,6 +21,7 @@ package de.steamwar.fightsystem; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.core.Core; +import de.steamwar.core.WorldIdentifier; import de.steamwar.core.worldedit.SteamEdit; import de.steamwar.core.worldedit.WorldEditRendererCUIEditor; import de.steamwar.fightsystem.fight.Fight; @@ -49,6 +50,9 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerPickupArrowEvent; import org.bukkit.plugin.java.JavaPlugin; +import java.nio.charset.StandardCharsets; +import java.util.HexFormat; + public class FightSystem extends JavaPlugin { @Getter @@ -79,6 +83,11 @@ public class FightSystem extends JavaPlugin { Core.setServerName("Replay"); } + String arenaMap = System.getProperty("arenaMap"); + if (arenaMap != null) { + WorldIdentifier.set("fight/" + HexFormat.of().formatHex(arenaMap.getBytes(StandardCharsets.UTF_8))); + } + message = new Message("de.steamwar.fightsystem.FightSystem", FightSystem.class.getClassLoader()); spigotLinker = new SpigotLinker(this, message) { diff --git a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java index a4dc58fc..44932fdf 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java +++ b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java @@ -91,6 +91,7 @@ public class ServerStarter { gameMode = mode.configFile.getName().replace(".yml", ""); directory = new File(SERVER_PATH, mode.Server.Folder); arguments.put("config", mode.configFile.getName()); + arguments.put("arenaMap", gameMode + "/" + map); tempWorld(SERVER_PATH + mode.Server.Folder + "/arenas/" + map); startCondition = () -> { if (playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) { From 460d016295a9fe33dd6158a881f1245b96bfe5c1 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:35:42 +0100 Subject: [PATCH 4/8] Change naming to fight// --- .../src/de/steamwar/fightsystem/FightSystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index 5da7c23a..e6238387 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -85,7 +85,7 @@ public class FightSystem extends JavaPlugin { String arenaMap = System.getProperty("arenaMap"); if (arenaMap != null) { - WorldIdentifier.set("fight/" + HexFormat.of().formatHex(arenaMap.getBytes(StandardCharsets.UTF_8))); + WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap); } message = new Message("de.steamwar.fightsystem.FightSystem", FightSystem.class.getClassLoader()); From d196f49ba2b800395c590054eea460aab9ead9d2 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:45:32 +0100 Subject: [PATCH 5/8] Add arena map world name identifier for TowerRun and TNTLeague --- TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt | 7 +++++++ TowerRun/src/de/steamwar/towerrun/TowerRun.java | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt b/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt index 588b6864..5dc3b8b6 100644 --- a/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt +++ b/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt @@ -19,6 +19,8 @@ package de.steamwar.tntleague +import de.steamwar.core.Core +import de.steamwar.core.WorldIdentifier import de.steamwar.message.Message import de.steamwar.tntleague.command.* import de.steamwar.tntleague.events.GlobalListener @@ -43,6 +45,11 @@ class TNTLeague : JavaPlugin() { logger.info("TNTLeague enabled") + val arenaMap = System.getProperty("arenaMap") + if (arenaMap != null) { + WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap) + } + ReadyCommand.register() InviteCommand.register() AcceptCommand.register() diff --git a/TowerRun/src/de/steamwar/towerrun/TowerRun.java b/TowerRun/src/de/steamwar/towerrun/TowerRun.java index 10298547..30dd4046 100644 --- a/TowerRun/src/de/steamwar/towerrun/TowerRun.java +++ b/TowerRun/src/de/steamwar/towerrun/TowerRun.java @@ -20,6 +20,8 @@ package de.steamwar.towerrun; import de.steamwar.command.SWCommand; +import de.steamwar.core.Core; +import de.steamwar.core.WorldIdentifier; import de.steamwar.linkage.AbstractLinker; import de.steamwar.linkage.LinkedInstance; import de.steamwar.linkage.SpigotLinker; @@ -56,6 +58,11 @@ public class TowerRun extends JavaPlugin { towerGenerator = new TowerGenerator(WorldConfig.TOWER_GENERATOR_CONFIG); } + String arenaMap = System.getProperty("arenaMap"); + if (arenaMap != null) { + WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap); + } + SpigotLinker spigotLinker = new SpigotLinker(this, message) { @Override protected void linkObject(Object any) { @@ -64,6 +71,7 @@ public class TowerRun extends JavaPlugin { } } }; + try { spigotLinker.link(); } catch (AbstractLinker.LinkException e) { From 641962ff01f75d1b1cd4c4fb5219742c459d71c6 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:47:18 +0100 Subject: [PATCH 6/8] change arena map identifier to arena/<... --- .../src/de/steamwar/fightsystem/FightSystem.java | 2 +- MissileWars/src/de/steamwar/misslewars/MissileWars.java | 7 +++++++ TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt | 2 +- TowerRun/src/de/steamwar/towerrun/TowerRun.java | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index e6238387..2e6f83e9 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -85,7 +85,7 @@ public class FightSystem extends JavaPlugin { String arenaMap = System.getProperty("arenaMap"); if (arenaMap != null) { - WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap); + WorldIdentifier.set("arena/" + Core.getVersion() + "/" + arenaMap); } message = new Message("de.steamwar.fightsystem.FightSystem", FightSystem.class.getClassLoader()); diff --git a/MissileWars/src/de/steamwar/misslewars/MissileWars.java b/MissileWars/src/de/steamwar/misslewars/MissileWars.java index 7734cc74..44467069 100644 --- a/MissileWars/src/de/steamwar/misslewars/MissileWars.java +++ b/MissileWars/src/de/steamwar/misslewars/MissileWars.java @@ -19,6 +19,8 @@ package de.steamwar.misslewars; +import de.steamwar.core.Core; +import de.steamwar.core.WorldIdentifier; import de.steamwar.linkage.AbstractLinker; import de.steamwar.linkage.SpigotLinker; import de.steamwar.misslewars.items.CustomItem; @@ -56,6 +58,11 @@ public class MissileWars extends JavaPlugin { redTeam = new MWTeam(Config.TeamRedColor, Config.RedSpawn, Config.TeamRedName, Config.RedPortalZ); blueTeam = new MWTeam(Config.TeamBlueColor, Config.BlueSpawn, Config.TeamBlueName, Config.BluePortalZ); + String arenaMap = System.getProperty("arenaMap"); + if (arenaMap != null) { + WorldIdentifier.set("arena/" + Core.getVersion() + "/" + arenaMap); + } + SpigotLinker spigotLinker = new SpigotLinker(this, null) { @Override protected void linkObject(Object any) { diff --git a/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt b/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt index 5dc3b8b6..f5a3893d 100644 --- a/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt +++ b/TNTLeague/src/de/steamwar/tntleague/TNTLeague.kt @@ -47,7 +47,7 @@ class TNTLeague : JavaPlugin() { val arenaMap = System.getProperty("arenaMap") if (arenaMap != null) { - WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap) + WorldIdentifier.set("arena/" + Core.getVersion() + "/" + arenaMap) } ReadyCommand.register() diff --git a/TowerRun/src/de/steamwar/towerrun/TowerRun.java b/TowerRun/src/de/steamwar/towerrun/TowerRun.java index 30dd4046..f75a6747 100644 --- a/TowerRun/src/de/steamwar/towerrun/TowerRun.java +++ b/TowerRun/src/de/steamwar/towerrun/TowerRun.java @@ -60,7 +60,7 @@ public class TowerRun extends JavaPlugin { String arenaMap = System.getProperty("arenaMap"); if (arenaMap != null) { - WorldIdentifier.set("fight/" + Core.getVersion() + "/" + arenaMap); + WorldIdentifier.set("arena/" + Core.getVersion() + "/" + arenaMap); } SpigotLinker spigotLinker = new SpigotLinker(this, message) { From ded46c28a6aed920a79930450d3b645cabf85990 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:50:54 +0100 Subject: [PATCH 7/8] change arena map identifier to not use gamemode --- VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java index 44932fdf..4070ea6f 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java +++ b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java @@ -91,7 +91,7 @@ public class ServerStarter { gameMode = mode.configFile.getName().replace(".yml", ""); directory = new File(SERVER_PATH, mode.Server.Folder); arguments.put("config", mode.configFile.getName()); - arguments.put("arenaMap", gameMode + "/" + map); + arguments.put("arenaMap", map); tempWorld(SERVER_PATH + mode.Server.Folder + "/arenas/" + map); startCondition = () -> { if (playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) { From e22317f1fa9c267329231b631c42045bb27151d2 Mon Sep 17 00:00:00 2001 From: Jakob Schulz <55949993+Lordikak@users.noreply.github.com> Date: Sat, 31 Oct 2026 23:02:23 +0100 Subject: [PATCH 8/8] optimize imports --- .../src/de/steamwar/fightsystem/FightSystem.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index 2e6f83e9..66cc8fff 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -23,7 +23,6 @@ import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.core.Core; import de.steamwar.core.WorldIdentifier; import de.steamwar.core.worldedit.SteamEdit; -import de.steamwar.core.worldedit.WorldEditRendererCUIEditor; import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.listener.ClickAnalyzer; @@ -50,9 +49,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerPickupArrowEvent; import org.bukkit.plugin.java.JavaPlugin; -import java.nio.charset.StandardCharsets; -import java.util.HexFormat; - public class FightSystem extends JavaPlugin { @Getter