Add GameModeConfig.ArenaConfig.WaterDamage for hard water damage by setting air or normal handling

This commit is contained in:
2026-03-01 21:36:29 +01:00
parent 30b7bbc283
commit bce07a4ac8
2 changed files with 9 additions and 0 deletions
@@ -402,6 +402,13 @@ public final class GameModeConfig<M, W> {
*/
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<M, W> {
private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List<Integer> 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);
@@ -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;