From bce07a4ac826eff72624da4773e92594a17ac6a3 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 1 Mar 2026 21:36:29 +0100 Subject: [PATCH] Add GameModeConfig.ArenaConfig.WaterDamage for hard water damage by setting air or normal handling --- CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java | 8 ++++++++ .../src/de/steamwar/fightsystem/listener/Permanent.java | 1 + 2 files changed, 9 insertions(+) diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index 2a737508..dc4e7300 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -402,6 +402,13 @@ public final class GameModeConfig { */ public final int WaterDepth; + /** + * If TNT should break blocks even underwater + * + * @implSpec {@code true} by default + */ + public final boolean WaterDamage; + /** * The outer border of the arena, measured in blocks around the schematic areas */ @@ -457,6 +464,7 @@ public final class GameModeConfig { private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List EnterStages) { loaded = loader.canLoad(); WaterDepth = loader.getInt("WaterDepth", 0); + WaterDamage = loader.getBoolean("WaterDamage", true); Schem2Border = new Schem2BorderConfig(loader.with("Schem2Border")); SpawnOffset = new SpawnOffsetConfig(loader.with("SpawnOffset"), Size); BorderFromSchematic = loader.getInt("BorderFromSchematic", 21); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index f878e12c..9d353d30 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -182,6 +182,7 @@ public class Permanent implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onExplosion(EntityExplodeEvent e) { if (!(e.getEntity() instanceof TNTPrimed)) return; + if (!Config.GameModeConfig.Arena.WaterDamage) return; e.blockList().removeIf(block -> { if(block.getType() == Material.TNT) { return false;