From c7a949322e6b43ac4d1cd43205b9c71398afd53d Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 11:08:51 +0200 Subject: [PATCH 01/14] Fix Windcharge remove Water --- .../src/de/steamwar/fightsystem/listener/WaterRemover.java | 1 + 1 file changed, 1 insertion(+) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java index c85da5ce..4ff136b1 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java @@ -72,6 +72,7 @@ public class WaterRemover implements Listener { @EventHandler public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.TNT) return; event.setYield(0); //No drops (additionally to world config) FightTeam spawn = tnt.remove(event.getEntity().getEntityId()); From 72dc4eee9e5ed96e88b69fa658c08874878dab2c Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:43:23 +0200 Subject: [PATCH 02/14] Fix Wind charges cross middle and interact with Blocks --- .../fightsystem/listener/Windcharge.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java new file mode 100644 index 00000000..9c1f86a3 --- /dev/null +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java @@ -0,0 +1,88 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.listener; + +import de.steamwar.fightsystem.Config; +import de.steamwar.fightsystem.FightSystem; +import de.steamwar.fightsystem.fight.FightWorld; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentListener; +import de.steamwar.fightsystem.states.StateDependentTask; +import de.steamwar.linkage.Linked; +import io.papermc.paper.event.entity.EntityMoveEvent; +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntitySpawnEvent; + +import java.util.HashSet; +import java.util.Set; + +@Linked +public class Windcharge implements Listener { + + private static final int middleLine = Config.SpecSpawn.getBlockZ(); + + private final Set windcharges = new HashSet<>(); + + public Windcharge() { + new StateDependentListener(true, FightState.Running, this); + new StateDependentTask(true, FightState.Running, this::run, 1, 1); + } + + @EventHandler + public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + if (!Config.WindchargesInteractWithBlocks) { + event.blockList().clear(); + } + if (!Config.WindchargesCanCrossMiddle) { + windcharges.remove(event.getEntity()); + } + } + + @EventHandler + public void handleEntitySpawnEvent(EntitySpawnEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + if (!Config.WindchargesCanCrossMiddle) { + windcharges.add(event.getEntity()); + } + } + + public void run() { + if (!Config.WindchargesCanCrossMiddle) { + windcharges.forEach(entity -> { + Location nextlocation = entity.getLocation().add(entity.getVelocity()); + Location location = entity.getLocation(); + + boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || + nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; + + if (passedMiddle) { + windcharges.remove(entity); + entity.remove(); + } + }); + } + } +} From c40f29c3c1d278afb212ea2a602fa2057cfcac2b Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:43:46 +0200 Subject: [PATCH 03/14] Add Wind charge config --- FightSystem/FightSystem_Core/src/config.yml | 2 ++ .../FightSystem_Core/src/de/steamwar/fightsystem/Config.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/FightSystem/FightSystem_Core/src/config.yml b/FightSystem/FightSystem_Core/src/config.yml index 81620820..a080d253 100644 --- a/FightSystem/FightSystem_Core/src/config.yml +++ b/FightSystem/FightSystem_Core/src/config.yml @@ -64,6 +64,8 @@ Arena: 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 + windchargesCanCrossMiddle: false # defaults to false if missing + windchargesInteractWithBlocks: false # defaults to false if missing Schematic: # The size of the schematics diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index c8a5883c..3ad22480 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -64,6 +64,9 @@ public class Config { private static final int BlueToRedY; public static final int BlueToRedZ; + public static final boolean WindchargesCanCrossMiddle; + public static final boolean WindchargesInteractWithBlocks; + //schematic parameter public static final boolean OnlyPublicSchematics; @@ -102,6 +105,8 @@ public class Config { CheckSchemID = Integer.parseInt(System.getProperty("checkSchemID", "0")); PrepareSchemID = Integer.parseInt(System.getProperty("prepareSchemID", "0")); ReplayID = Integer.parseInt(System.getProperty("replay", "0")); + WindchargesCanCrossMiddle = Boolean.getBoolean(System.getProperty("windchargesCanCrossMiddle", "false")); + WindchargesInteractWithBlocks = Boolean.getBoolean(System.getProperty("windchargesInteractWithBlocks", "false")); String configFile = System.getProperty("config", "config.yml"); if (!new File(FightSystem.getPlugin().getDataFolder(), configFile).exists()) { From 0684765a765edd956255b4ac13293b6f62a19248 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:49:23 +0200 Subject: [PATCH 04/14] Remove unused imports --- .../src/de/steamwar/fightsystem/listener/Windcharge.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java index 9c1f86a3..f2a90869 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java @@ -20,13 +20,10 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.Config; -import de.steamwar.fightsystem.FightSystem; -import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentTask; import de.steamwar.linkage.Linked; -import io.papermc.paper.event.entity.EntityMoveEvent; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; From c62a566447419ab8060b82a167904f202434eef3 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 14:58:24 +0200 Subject: [PATCH 05/14] Fix pull Request comment --- .../src/de/steamwar/sql/GameModeConfig.java | 24 ++++++ FightSystem/FightSystem_Core/src/config.yml | 6 +- .../src/de/steamwar/fightsystem/Config.java | 5 -- .../fightsystem/listener/WaterRemover.java | 4 +- .../fightsystem/listener/Windcharge.java | 85 ------------------- .../WindchargeInteractionDisabler.java | 44 ++++++++++ .../listener/WindchargeStopper.java | 12 +-- 7 files changed, 81 insertions(+), 99 deletions(-) delete mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java create mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index 82ab638b..87c6bdb1 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -488,6 +488,27 @@ public final class GameModeConfig { */ public final boolean NoFloor; + /** + * Allows Wind Charges to cross the Middle. + * + * @implSpec {@code false} by default + */ + public final boolean WindchargesCanCrossMiddle; + + /** + * Allows Wind Charge interaction with Blocks. + * + * @implSpec {@code true} by default + */ + public final boolean WindchargesInteractWithBlocks; + + /** + * Allows Wind Charge to destroy Water. + * + * @implSpec {@code false} by default + */ + public final boolean WindchargesDestroyWater; + private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List EnterStages) { loaded = loader.canLoad(); WaterDepth = loader.getInt("WaterDepth", 0); @@ -505,6 +526,9 @@ public final class GameModeConfig { Leaveable = loader.getBoolean("Leaveable", false); AllowMissiles = loader.getBoolean("AllowMissiles", !EnterStages.isEmpty()); NoFloor = loader.getBoolean("NoFloor", false); + WindchargesCanCrossMiddle = loader.getBoolean("WindchargesCanCrossMiddle", false); + WindchargesInteractWithBlocks = loader.getBoolean("WindchargesInteractWithBlocks", true); + WindchargesDestroyWater = loader.getBoolean("WindchargesDestroyWater", false); } @ToString diff --git a/FightSystem/FightSystem_Core/src/config.yml b/FightSystem/FightSystem_Core/src/config.yml index a080d253..185704d5 100644 --- a/FightSystem/FightSystem_Core/src/config.yml +++ b/FightSystem/FightSystem_Core/src/config.yml @@ -64,8 +64,10 @@ Arena: 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 - windchargesCanCrossMiddle: false # defaults to false if missing - windchargesInteractWithBlocks: false # defaults to false if missing + # Allows Wind Charges to cross the Middle. + WindchargesCanCrossMiddle: false # defaults to false if missing + # Allows Wind Charge interaction with Blocks. + WindchargesInteractWithBlocks: false # defaults to false if missing Schematic: # The size of the schematics diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index 3ad22480..c8a5883c 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -64,9 +64,6 @@ public class Config { private static final int BlueToRedY; public static final int BlueToRedZ; - public static final boolean WindchargesCanCrossMiddle; - public static final boolean WindchargesInteractWithBlocks; - //schematic parameter public static final boolean OnlyPublicSchematics; @@ -105,8 +102,6 @@ public class Config { CheckSchemID = Integer.parseInt(System.getProperty("checkSchemID", "0")); PrepareSchemID = Integer.parseInt(System.getProperty("prepareSchemID", "0")); ReplayID = Integer.parseInt(System.getProperty("replay", "0")); - WindchargesCanCrossMiddle = Boolean.getBoolean(System.getProperty("windchargesCanCrossMiddle", "false")); - WindchargesInteractWithBlocks = Boolean.getBoolean(System.getProperty("windchargesInteractWithBlocks", "false")); String configFile = System.getProperty("config", "config.yml"); if (!new File(FightSystem.getPlugin().getDataFolder(), configFile).exists()) { diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java index 4ff136b1..bded9613 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java @@ -72,7 +72,9 @@ public class WaterRemover implements Listener { @EventHandler public void handleEntityExplode(EntityExplodeEvent event) { - if (event.getEntityType() != EntityType.TNT) return; + if (event.getEntityType() == EntityType.WIND_CHARGE && !Config.GameModeConfig.Arena.WindchargesDestroyWater) { + return; + } event.setYield(0); //No drops (additionally to world config) FightTeam spawn = tnt.remove(event.getEntity().getEntityId()); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java deleted file mode 100644 index f2a90869..00000000 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2026 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.fightsystem.listener; - -import de.steamwar.fightsystem.Config; -import de.steamwar.fightsystem.states.FightState; -import de.steamwar.fightsystem.states.StateDependentListener; -import de.steamwar.fightsystem.states.StateDependentTask; -import de.steamwar.linkage.Linked; -import org.bukkit.Location; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntitySpawnEvent; - -import java.util.HashSet; -import java.util.Set; - -@Linked -public class Windcharge implements Listener { - - private static final int middleLine = Config.SpecSpawn.getBlockZ(); - - private final Set windcharges = new HashSet<>(); - - public Windcharge() { - new StateDependentListener(true, FightState.Running, this); - new StateDependentTask(true, FightState.Running, this::run, 1, 1); - } - - @EventHandler - public void handleEntityExplode(EntityExplodeEvent event) { - if (event.getEntityType() != EntityType.WIND_CHARGE) return; - if (!Config.WindchargesInteractWithBlocks) { - event.blockList().clear(); - } - if (!Config.WindchargesCanCrossMiddle) { - windcharges.remove(event.getEntity()); - } - } - - @EventHandler - public void handleEntitySpawnEvent(EntitySpawnEvent event) { - if (event.getEntityType() != EntityType.WIND_CHARGE) return; - if (!Config.WindchargesCanCrossMiddle) { - windcharges.add(event.getEntity()); - } - } - - public void run() { - if (!Config.WindchargesCanCrossMiddle) { - windcharges.forEach(entity -> { - Location nextlocation = entity.getLocation().add(entity.getVelocity()); - Location location = entity.getLocation(); - - boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || - nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; - - if (passedMiddle) { - windcharges.remove(entity); - entity.remove(); - } - }); - } - } -} diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java new file mode 100644 index 00000000..7c518b2a --- /dev/null +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java @@ -0,0 +1,44 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.listener; + +import de.steamwar.fightsystem.Config; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentListener; +import de.steamwar.linkage.Linked; +import org.bukkit.entity.EntityType; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; + +@Linked +public class WindchargeInteractionDisabler implements Listener { + + public WindchargeInteractionDisabler() { + new StateDependentListener(!Config.GameModeConfig.Arena.WindchargesInteractWithBlocks, FightState.Running, this); + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + event.blockList().clear(); + } +} 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 9abfc92d..a750a1b9 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java @@ -23,14 +23,14 @@ import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentTask; import de.steamwar.linkage.Linked; +import net.minecraft.world.entity.projectile.windcharge.WindCharge; import org.bukkit.Location; -import org.bukkit.entity.WindCharge; @Linked public class WindchargeStopper { public WindchargeStopper() { - new StateDependentTask(true, FightState.Running, this::run, 1, 1); + new StateDependentTask(!Config.GameModeConfig.Arena.WindchargesCanCrossMiddle, FightState.Running, this::run, 1, 1); } private static final int middleLine = Config.SpecSpawn.getBlockZ(); @@ -39,13 +39,13 @@ public class WindchargeStopper { private void run() { Recording.iterateOverEntities(windChargeClass::isInstance, entity -> { + Location nextlocation = entity.getLocation().add(entity.getVelocity()); Location location = entity.getLocation(); - Location prevLocation = location.clone().subtract(entity.getVelocity()); - boolean passedMiddle = location.getBlockZ() > middleLine && prevLocation.getBlockZ() > middleLine || - location.getBlockZ() < middleLine && prevLocation.getBlockZ() < middleLine; + boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || + nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; - if (!passedMiddle) { + if (passedMiddle) { entity.remove(); } }); From 2be3a136ae244e99630f6be9a01edf1c720f086d Mon Sep 17 00:00:00 2001 From: Sakziea Date: Fri, 24 Jul 2026 11:02:49 +0200 Subject: [PATCH 06/14] Add funktion to show next events and formatet the fights in pages --- .../steamwar/messages/BungeeCore.properties | 8 ++ .../messages/BungeeCore_de.properties | 8 ++ .../velocitycore/commands/EventCommand.java | 119 ++++++++++++++++-- 3 files changed, 125 insertions(+), 10 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index 0dd2a7d6..bca27a8e 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -272,6 +272,8 @@ CHALLENGE_ACCEPT_HOVER = §aAccept challenge EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. EVENT_USAGE = §8/§7event §8[§eTeam§8] - §7To teleport to a fight +EVENT_TEAM_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight +EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7To show the fights of that Event EVENT_NO_TEAM = §cThis team does not exist EVENT_NO_FIGHT_TEAM = §cThis team has no current fight EVENT_NO_CURRENT = §cThere is no event taking place currently @@ -751,3 +753,9 @@ DC_SCHEMUPLOAD_IGNORED = Skipping `{0}`, not a schematic file. DC_SCHEMUPLOAD_INVCHAR = `{0}` has invalid characters in its name. DC_SCHEMUPLOAD_SUCCESS = `{0}` was uploaded successfully. DC_SCHEMUPLOAD_ERROR = An error has occured during the upload of `{0}`. For more information ask a Developer. + +UTIL_LIST_BACK_ARROW = §8«« +UTIL_LIST_BACK_ARROW_HOVER = §ePrevious page +UTIL_LIST_PAGE = §e Page §7({0}/{1}) +UTIL_LIST_NEXT = §8 »» +UTIL_LIST_NEXT_HOVER = §eNext page \ No newline at end of file diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index 47b815ea..39e579c4 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -254,6 +254,8 @@ CHALLENGE_ACCEPT_HOVER = §aHerausforderung annehmen EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. EVENT_USAGE = §8/§7event §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren +EVENT_TEAM_USAGE=§8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren +EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7Um die fights des Events zu zeigen EVENT_NO_TEAM = §cDieses Team gibt es nicht EVENT_NO_FIGHT_TEAM = §cDas Team kämpft derzeit nicht EVENT_NO_CURRENT = §cDerzeit findet kein Event statt @@ -692,3 +694,9 @@ DC_SCHEMUPLOAD_IGNORED = `{0}` wird ignoriert, da die Datei keine Schematic ist. DC_SCHEMUPLOAD_INVCHAR = `{0}` hat unzulässige Buchstaben im Namen. DC_SCHEMUPLOAD_SUCCESS = `{0}` wurde erfolgreich hochgeladen. DC_SCHEMUPLOAD_ERROR = Ein Fehler ist beim Hochladen von `{0}` aufgetreten. Für nähere Informationen wende dich an einen Developer. + +UTIL_LIST_BACK_ARROW = §8«« +UTIL_LIST_BACK_ARROW_HOVER = §eLetste Seite +UTIL_LIST_PAGE = §e Seite §7({0}/{1}) +UTIL_LIST_NEXT = §8 »» +UTIL_LIST_NEXT_HOVER = §eNächste Seite \ No newline at end of file diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index 27fb38bd..a5aa662d 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -25,16 +25,23 @@ import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeValidator; import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; +import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; import de.steamwar.persistent.Subserver; import de.steamwar.sql.*; +import de.steamwar.sql.Event; import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.SubserverSystem; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.ClickEvent; +import javax.security.auth.callback.CallbackHandler; +import java.awt.*; import java.sql.Timestamp; import java.time.Instant; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; @@ -86,9 +93,58 @@ public class EventCommand extends SWCommand { Event currentEvent = Event.get(); sender.system("EVENT_CURRENT_EVENT", currentEvent.getEventName()); + sendEvent(sender, currentEvent); + } + + @Register(value = "show", description = "EVENT_SHOW_USAGE") + public void eventShow(Chatter sender, Event event) { + eventShowPage(sender, event, 1); + } + + @Register(value = "show", description = "EVENT_SHOW_USAGE") + public void eventShowPage(Chatter sender, Event event, int page) { + if (!Instant.now().isBefore(event.getEnd().toInstant())) return; + int pagecount = sendEventPage(sender, event, page); + + Integer nextpage = page + 1; + Integer prevpage = page - 1; + + Component finalmessage; + + Component pagenumber = sender.parse("UTIL_LIST_PAGE", page, pagecount); + + if (pagecount != 0 && page != 1) { + finalmessage = sender.parse("UTIL_LIST_BACK_ARROW"); + finalmessage = finalmessage.clickEvent(ClickEvent.runCommand("/event show " + event.getEventName() + " " + prevpage)); + finalmessage = finalmessage.append(pagenumber); + } else { + finalmessage = pagenumber; + } + + if (pagecount != 0 && pagecount > page) { + Component nextbutton = sender.parse("UTIL_LIST_NEXT"); + nextbutton = nextbutton.clickEvent(ClickEvent.runCommand("/event show " + event.getEventName() + " " + nextpage)); + finalmessage = finalmessage.append(nextbutton); + } + sender.sendMessage(finalmessage); + } + + @Register(value = "team", description = "EVENT_TEAM_USAGE") + public void eventWithTeam(@Validator(value = "noEvent", invert = true) PlayerChatter sender, @ErrorMessage("EVENT_NO_TEAM") Team team) { + Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId()); + if (eventArena == null || !Subserver.getServerList().contains(eventArena)) { + sender.system("EVENT_NO_FIGHT_TEAM"); + return; + } + if (!PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) { + SubserverSystem.sendPlayer(eventArena, sender.getPlayer()); + } + } + + private void sendEvent(Chatter sender, Event event) { DateTimeFormatter format = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_TIME_FORMAT")); - for (EventFight fight : EventFight.getEvent(currentEvent.getEventID())) { + for (EventFight fight : EventFight.getEvent(event.getEventID())) { Team blue = Team.byId(fight.getTeamBlue()); Team red = Team.byId(fight.getTeamRed()); StringBuilder fline = new StringBuilder(sender.parseToLegacy("EVENT_CURRENT_FIGHT", fight.getStartTime().toLocalDateTime().format(format), blue.getTeamColor(), blue.getTeamKuerzel(), red.getTeamColor(), red.getTeamKuerzel())); @@ -110,16 +166,59 @@ public class EventCommand extends SWCommand { } } - @Register - public void eventWithTeam(@Validator(value = "noEvent", invert = true) PlayerChatter sender, @ErrorMessage("EVENT_NO_TEAM") Team team) { - Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId()); - if (eventArena == null || !Subserver.getServerList().contains(eventArena)) { - sender.system("EVENT_NO_FIGHT_TEAM"); - return; - } - if (!PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) { - SubserverSystem.sendPlayer(eventArena, sender.getPlayer()); + private int sendEventPage(Chatter sender, Event event, int page) { + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_DATE_FORMAT")); + Map> dates = EventFight.getEvent(event.getEventID()).stream().collect(Collectors.groupingBy(p -> p.getStartTime().toLocalDateTime().format(dateTimeFormatter))); + if (dates.size() >= page) { + DateTimeFormatter format = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_TIME_FORMAT")); + for (EventFight eventFight : dates.get(dates.keySet().toArray()[page - 1])) { + Team blue = Team.byId(eventFight.getTeamBlue()); + Team red = Team.byId(eventFight.getTeamRed()); + StringBuilder fline = new StringBuilder(sender.parseToLegacy("EVENT_CURRENT_FIGHT", eventFight.getStartTime().toLocalDateTime().format(format), blue.getTeamColor(), blue.getTeamKuerzel(), red.getTeamColor(), red.getTeamKuerzel())); + + if (eventFight.hasFinished()) { + switch (eventFight.getErgebnis()) { + case 1: + fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", blue.getTeamColor(), blue.getTeamKuerzel())); + break; + case 2: + fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", red.getTeamColor(), red.getTeamKuerzel())); + break; + default: + fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_DRAW")); + } + } + + sender.prefixless("PLAIN_STRING", fline.toString()); + } } + return dates.size(); + } + + protected static TypeMapper eventTypeMapper() { + return new TypeMapper<>() { + @Override + public Event map(Chatter sender, PreviousArguments previousArguments, String s) { + return Event.get(s); + } + + @Override + public Collection tabCompletes(Chatter sender, PreviousArguments previousArguments, String s) { + Set events = new HashSet<>(); + List allevents = Event.getAll(); + for (Event event : allevents) { + if (!Instant.now().isAfter(event.getEnd().toInstant())) { + events.add(event.getEventName()); + } + } + return events; + } + }; + } + + @ClassMapper(value = Event.class, local = true) + public TypeMapper eventMapper() { + return eventTypeMapper(); } protected static TypeMapper eventTeam(Function> teamMapper) { From 493e66cc98021f0470d28d7e7cd20fab4a18cce3 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 25 Jul 2026 10:40:59 +0200 Subject: [PATCH 07/14] Add current event uses eventpage --- .../velocitycore/commands/EventCommand.java | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index a5aa662d..de992a0e 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -92,8 +92,7 @@ public class EventCommand extends SWCommand { sender.system("EVENT_USAGE"); Event currentEvent = Event.get(); - sender.system("EVENT_CURRENT_EVENT", currentEvent.getEventName()); - sendEvent(sender, currentEvent); + eventShowPage(sender, currentEvent, 1); } @Register(value = "show", description = "EVENT_SHOW_USAGE") @@ -141,35 +140,11 @@ public class EventCommand extends SWCommand { } } - private void sendEvent(Chatter sender, Event event) { - - DateTimeFormatter format = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_TIME_FORMAT")); - for (EventFight fight : EventFight.getEvent(event.getEventID())) { - Team blue = Team.byId(fight.getTeamBlue()); - Team red = Team.byId(fight.getTeamRed()); - StringBuilder fline = new StringBuilder(sender.parseToLegacy("EVENT_CURRENT_FIGHT", fight.getStartTime().toLocalDateTime().format(format), blue.getTeamColor(), blue.getTeamKuerzel(), red.getTeamColor(), red.getTeamKuerzel())); - - if (fight.hasFinished()) { - switch (fight.getErgebnis()) { - case 1: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", blue.getTeamColor(), blue.getTeamKuerzel())); - break; - case 2: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", red.getTeamColor(), red.getTeamKuerzel())); - break; - default: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_DRAW")); - } - } - - sender.prefixless("PLAIN_STRING", fline.toString()); - } - } - private int sendEventPage(Chatter sender, Event event, int page) { DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_DATE_FORMAT")); Map> dates = EventFight.getEvent(event.getEventID()).stream().collect(Collectors.groupingBy(p -> p.getStartTime().toLocalDateTime().format(dateTimeFormatter))); if (dates.size() >= page) { + sender.system("EVENT_CURRENT_EVENT", event.getEventName()); DateTimeFormatter format = DateTimeFormatter.ofPattern(sender.parseToPlain("EVENT_TIME_FORMAT")); for (EventFight eventFight : dates.get(dates.keySet().toArray()[page - 1])) { Team blue = Team.byId(eventFight.getTeamBlue()); From 5fdfc03587653fba086615fd2b536c3c62b4a1bb Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 25 Jul 2026 10:41:45 +0200 Subject: [PATCH 08/14] Fix /event [Team] move to /event team [Team] --- VelocityCore/src/de/steamwar/messages/BungeeCore.properties | 2 +- VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index bca27a8e..6a86e859 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -271,7 +271,7 @@ CHALLENGE_ACCEPT_HOVER = §aAccept challenge #EventCommand EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. -EVENT_USAGE = §8/§7event §8[§eTeam§8] - §7To teleport to a fight +EVENT_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight EVENT_TEAM_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7To show the fights of that Event EVENT_NO_TEAM = §cThis team does not exist diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index 39e579c4..dcfd810b 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -253,7 +253,7 @@ CHALLENGE_ACCEPT_HOVER = §aHerausforderung annehmen #EventCommand EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. -EVENT_USAGE = §8/§7event §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren +EVENT_USAGE = §8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren EVENT_TEAM_USAGE=§8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7Um die fights des Events zu zeigen EVENT_NO_TEAM = §cDieses Team gibt es nicht From 97773f292df8ab0b2991e68acb9c8f984a81882d Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 25 Jul 2026 10:45:26 +0200 Subject: [PATCH 09/14] Remove unused import --- .../src/de/steamwar/velocitycore/commands/EventCommand.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index de992a0e..c0e212cd 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -25,7 +25,6 @@ import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeValidator; import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; -import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; import de.steamwar.persistent.Subserver; import de.steamwar.sql.*; @@ -35,7 +34,6 @@ import de.steamwar.velocitycore.SubserverSystem; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; -import javax.security.auth.callback.CallbackHandler; import java.awt.*; import java.sql.Timestamp; import java.time.Instant; From a18098b8f40d4dd9399ee5f5c6e419e88e526e8f Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sun, 26 Jul 2026 07:58:11 +0200 Subject: [PATCH 10/14] Fix Pull request comments --- .../src/de/steamwar/messages/BungeeCore.properties | 1 - .../src/de/steamwar/messages/BungeeCore_de.properties | 7 ------- .../de/steamwar/velocitycore/commands/EventCommand.java | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index 6a86e859..e41aa576 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -271,7 +271,6 @@ CHALLENGE_ACCEPT_HOVER = §aAccept challenge #EventCommand EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. -EVENT_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight EVENT_TEAM_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7To show the fights of that Event EVENT_NO_TEAM = §cThis team does not exist diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index dcfd810b..0de71aa0 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -253,7 +253,6 @@ CHALLENGE_ACCEPT_HOVER = §aHerausforderung annehmen #EventCommand EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. -EVENT_USAGE = §8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren EVENT_TEAM_USAGE=§8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7Um die fights des Events zu zeigen EVENT_NO_TEAM = §cDieses Team gibt es nicht @@ -694,9 +693,3 @@ DC_SCHEMUPLOAD_IGNORED = `{0}` wird ignoriert, da die Datei keine Schematic ist. DC_SCHEMUPLOAD_INVCHAR = `{0}` hat unzulässige Buchstaben im Namen. DC_SCHEMUPLOAD_SUCCESS = `{0}` wurde erfolgreich hochgeladen. DC_SCHEMUPLOAD_ERROR = Ein Fehler ist beim Hochladen von `{0}` aufgetreten. Für nähere Informationen wende dich an einen Developer. - -UTIL_LIST_BACK_ARROW = §8«« -UTIL_LIST_BACK_ARROW_HOVER = §eLetste Seite -UTIL_LIST_PAGE = §e Seite §7({0}/{1}) -UTIL_LIST_NEXT = §8 »» -UTIL_LIST_NEXT_HOVER = §eNächste Seite \ No newline at end of file diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index c0e212cd..e90401af 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -87,7 +87,7 @@ public class EventCommand extends SWCommand { @Register public void eventOverview(@Validator(value = "noEvent", invert = true) Chatter sender) { - sender.system("EVENT_USAGE"); + sender.system("EVENT_TEAM_USAGE"); Event currentEvent = Event.get(); eventShowPage(sender, currentEvent, 1); From 507b7c25699c33d893c7870480f1e5309b90c874 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Wed, 5 Aug 2026 19:20:27 +0200 Subject: [PATCH 11/14] Add event showtable --- .../steamwar/messages/BungeeCore.properties | 4 +- .../messages/BungeeCore_de.properties | 4 +- .../velocitycore/commands/EventCommand.java | 55 ++++++++++++++++--- 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index e41aa576..8ca21d33 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -272,7 +272,7 @@ CHALLENGE_ACCEPT_HOVER = §aAccept challenge EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. EVENT_TEAM_USAGE = §8/§7event team §8[§eTeam§8] - §7To teleport to a fight -EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7To show the fights of that Event +EVENT_SHOW_FIGHTS_USAGE = §8/§7event showfights §8[§eEvent§8] - §7To show the fights of that Event EVENT_NO_TEAM = §cThis team does not exist EVENT_NO_FIGHT_TEAM = §cThis team has no current fight EVENT_NO_CURRENT = §cThere is no event taking place currently @@ -286,6 +286,8 @@ EVENT_CURRENT_EVENT = §e§l{0} EVENT_CURRENT_FIGHT = §7{0} §{1}{2}§8 vs §{3}{4} EVENT_CURRENT_FIGHT_WIN = §8: §7Victory §{0}{1} EVENT_CURRENT_FIGHT_DRAW = §8: §7Draw +EVENT_TEAM_TABLE = §{0}{1}{2} §8 with §e{3} §7points +EVENT_SHOW_TABLE_USAGE = §8/§7event showtable §8[§eEvent§8] - §7To show the table of that Event #EventRescheduleCommand EVENTRESCHEDULE_USAGE = §8/§7eventreschedule §8[§eTeam1§8] [§eTeam2§8] diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index 0de71aa0..60abb321 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -254,7 +254,7 @@ CHALLENGE_ACCEPT_HOVER = §aHerausforderung annehmen EVENT_TIME_FORMAT = HH:mm EVENT_DATE_FORMAT = dd.MM. EVENT_TEAM_USAGE=§8/§7event team §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren -EVENT_SHOW_USAGE = §8/§7event show §8[§eEvent§8] - §7Um die fights des Events zu zeigen +EVENT_SHOW_FIGHTS_USAGE = §8/§7event showfights §8[§eEvent§8] - §7Um die fights des Events zu zeigen EVENT_NO_TEAM = §cDieses Team gibt es nicht EVENT_NO_FIGHT_TEAM = §cDas Team kämpft derzeit nicht EVENT_NO_CURRENT = §cDerzeit findet kein Event statt @@ -268,6 +268,8 @@ EVENT_CURRENT_EVENT = §e§l{0} EVENT_CURRENT_FIGHT = §7{0} §{1}{2}§8 vs §{3}{4} EVENT_CURRENT_FIGHT_WIN = §8: §7Sieg §{0}{1} EVENT_CURRENT_FIGHT_DRAW = §8: §7Unentschieden +EVENT_TEAM_TABLE = §{0}{1}{2} §8 mit §e{3} §7Punkten +EVENT_SHOW_TABLE_USAGE = §8/§7event showtable §8[§eEvent§8] - §7Um die Tabelle des Events zu zeigen. #EventRescheduleCommand EVENTRESCHEDULE_USAGE = §8/§7eventreschedule §8[§eTeam1§8] [§eTeam2§8] diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index e90401af..cd34f121 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import com.google.protobuf.MapEntry; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; @@ -90,16 +91,54 @@ public class EventCommand extends SWCommand { sender.system("EVENT_TEAM_USAGE"); Event currentEvent = Event.get(); - eventShowPage(sender, currentEvent, 1); + eventShowFightsPage(sender, currentEvent, 1); } - @Register(value = "show", description = "EVENT_SHOW_USAGE") - public void eventShow(Chatter sender, Event event) { - eventShowPage(sender, event, 1); + @Register(value = "showtable", description = "EVENT_SHOW_TABLE_USAGE") + public void eventtable(Chatter sender, Event event) { + if (!Instant.now().isBefore(event.getEnd().toInstant())) return; + + Map Teampoints = new HashMap<>(); + + EventFight.getEvent(event.getEventID()).forEach(eventFight -> { + if (eventFight.hasFinished() && eventFight.getGroup().isPresent()) { + switch (eventFight.getErgebnis()) { + case 1: + //win blue + Teampoints.put(eventFight.getTeamBlue(), Teampoints.getOrDefault(eventFight.getTeamBlue(), 0) + eventFight.getGroup().get().getPointsPerWin()); + Teampoints.put(eventFight.getTeamRed(), Teampoints.getOrDefault(eventFight.getTeamRed(),0) + eventFight.getGroup().get().getPointsPerLoss()); + break; + case 2: + //win red + Teampoints.put(eventFight.getTeamBlue(), Teampoints.getOrDefault(eventFight.getTeamBlue(),0) + eventFight.getGroup().get().getPointsPerLoss()); + Teampoints.put(eventFight.getTeamRed(), Teampoints.getOrDefault(eventFight.getTeamRed(),0) + eventFight.getGroup().get().getPointsPerWin()); + break; + default: + //draw + Teampoints.put(eventFight.getTeamBlue(), Teampoints.getOrDefault(eventFight.getTeamBlue(),0) + eventFight.getGroup().get().getPointsPerDraw()); + Teampoints.put(eventFight.getTeamRed(), Teampoints.getOrDefault(eventFight.getTeamRed(),0) + eventFight.getGroup().get().getPointsPerDraw()); + } + } + }); + Map Teampointssortet = Teampoints.entrySet() + .stream() + .sorted(Map.Entry.comparingByValue()) + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (a , b) -> a, + LinkedHashMap::new + )); + + for (Map.Entry entry : Teampointssortet.entrySet()) { + Component finalmessage = sender.parse("EVENT_TEAM_TABLE",Team.byId(entry.getKey()).getTeamColor(), Team.byId(entry.getKey()).getTeamKuerzel(), Team.byId(entry.getKey()).getTeamName(), entry.getValue()); + finalmessage = finalmessage.clickEvent(ClickEvent.runCommand("/team info " + Team.byId(entry.getKey()).getTeamName())); + sender.sendMessage(finalmessage); + } } - @Register(value = "show", description = "EVENT_SHOW_USAGE") - public void eventShowPage(Chatter sender, Event event, int page) { + @Register(value = "showfights", description = "EVENT_SHOW_FIGHTS_USAGE") + public void eventShowFightsPage(Chatter sender, Event event, @AllowNull @OptionalValue("1") int page) { if (!Instant.now().isBefore(event.getEnd().toInstant())) return; int pagecount = sendEventPage(sender, event, page); @@ -112,7 +151,7 @@ public class EventCommand extends SWCommand { if (pagecount != 0 && page != 1) { finalmessage = sender.parse("UTIL_LIST_BACK_ARROW"); - finalmessage = finalmessage.clickEvent(ClickEvent.runCommand("/event show " + event.getEventName() + " " + prevpage)); + finalmessage = finalmessage.clickEvent(ClickEvent.runCommand("/event showfights " + event.getEventName() + " " + prevpage)); finalmessage = finalmessage.append(pagenumber); } else { finalmessage = pagenumber; @@ -120,7 +159,7 @@ public class EventCommand extends SWCommand { if (pagecount != 0 && pagecount > page) { Component nextbutton = sender.parse("UTIL_LIST_NEXT"); - nextbutton = nextbutton.clickEvent(ClickEvent.runCommand("/event show " + event.getEventName() + " " + nextpage)); + nextbutton = nextbutton.clickEvent(ClickEvent.runCommand("/event showfights " + event.getEventName() + " " + nextpage)); finalmessage = finalmessage.append(nextbutton); } sender.sendMessage(finalmessage); From a58de898bbe7148fb76dce300a469dc861cd4568 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Wed, 5 Aug 2026 19:32:42 +0200 Subject: [PATCH 12/14] Add Clickevents to EventPage --- .../velocitycore/commands/EventCommand.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index cd34f121..a775d71c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -186,22 +186,29 @@ public class EventCommand extends SWCommand { for (EventFight eventFight : dates.get(dates.keySet().toArray()[page - 1])) { Team blue = Team.byId(eventFight.getTeamBlue()); Team red = Team.byId(eventFight.getTeamRed()); - StringBuilder fline = new StringBuilder(sender.parseToLegacy("EVENT_CURRENT_FIGHT", eventFight.getStartTime().toLocalDateTime().format(format), blue.getTeamColor(), blue.getTeamKuerzel(), red.getTeamColor(), red.getTeamKuerzel())); + Component finalfightline = sender.parse("EVENT_CURRENT_FIGHT_1", eventFight.getStartTime().toLocalDateTime().format(format), blue.getTeamColor(), blue.getTeamKuerzel()); + finalfightline = finalfightline.clickEvent(ClickEvent.runCommand("/team info " + blue.getTeamName())); + Component vs = sender.parse("EVENT_CURRENT_FIGHT_VS"); + finalfightline = finalfightline.append(vs); + Component redteam = sender.parse("EVENT_CURRENT_FIGHT_2", red.getTeamColor(), red.getTeamKuerzel()); + redteam = redteam.clickEvent(ClickEvent.runCommand("/team info " + red.getTeamName())); + finalfightline = finalfightline.append(redteam); if (eventFight.hasFinished()) { + Component ergebnis; switch (eventFight.getErgebnis()) { case 1: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", blue.getTeamColor(), blue.getTeamKuerzel())); + ergebnis = sender.parse("EVENT_CURRENT_FIGHT_WIN", blue.getTeamColor(), blue.getTeamKuerzel()); break; case 2: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_WIN", red.getTeamColor(), red.getTeamKuerzel())); + ergebnis = sender.parse("EVENT_CURRENT_FIGHT_WIN", red.getTeamColor(), red.getTeamKuerzel()); break; default: - fline.append(sender.parseToLegacy("EVENT_CURRENT_FIGHT_DRAW")); + ergebnis = sender.parse("EVENT_CURRENT_FIGHT_DRAW"); } + finalfightline = finalfightline.append(ergebnis); } - - sender.prefixless("PLAIN_STRING", fline.toString()); + sender.sendMessage(finalfightline); } } return dates.size(); From 18ad0ad90ca56c8f5a56a2fc93ae7dfeba3d5e3b Mon Sep 17 00:00:00 2001 From: Sakziea Date: Wed, 5 Aug 2026 19:33:54 +0200 Subject: [PATCH 13/14] Add Clickevents to EventPage --- VelocityCore/src/de/steamwar/messages/BungeeCore.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index 8ca21d33..a546955f 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -283,7 +283,9 @@ EVENT_COMING_SCHEM_DEADLINE = §7 Submission deadline§8: §7{0} EVENT_COMING_TEAMS = §7 With§8: {0} EVENT_COMING_TEAM = §{0}{1} EVENT_CURRENT_EVENT = §e§l{0} -EVENT_CURRENT_FIGHT = §7{0} §{1}{2}§8 vs §{3}{4} +EVENT_CURRENT_FIGHT_1 = §7{0} §{1}{2} +EVENT_CURRENT_FIGHT_VS = §8 vs +EVENT_CURRENT_FIGHT_2 = §{1}{2} EVENT_CURRENT_FIGHT_WIN = §8: §7Victory §{0}{1} EVENT_CURRENT_FIGHT_DRAW = §8: §7Draw EVENT_TEAM_TABLE = §{0}{1}{2} §8 with §e{3} §7points From cce18124f21649fdf4fbd6a5618cb3472d0786fa Mon Sep 17 00:00:00 2001 From: Sakziea Date: Wed, 5 Aug 2026 19:34:12 +0200 Subject: [PATCH 14/14] Remove unused translation --- VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index 60abb321..c284208b 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -265,7 +265,6 @@ EVENT_COMING_SCHEM_DEADLINE = §7 Einsendeschluss§8: §7{0} EVENT_COMING_TEAMS = §7 Mit§8: {0} EVENT_COMING_TEAM = §{0}{1} EVENT_CURRENT_EVENT = §e§l{0} -EVENT_CURRENT_FIGHT = §7{0} §{1}{2}§8 vs §{3}{4} EVENT_CURRENT_FIGHT_WIN = §8: §7Sieg §{0}{1} EVENT_CURRENT_FIGHT_DRAW = §8: §7Unentschieden EVENT_TEAM_TABLE = §{0}{1}{2} §8 mit §e{3} §7Punkten