forked from SteamWar/SteamWar
Add GameModeConfig.ArenaConfig.WaterDamage for hard water damage by setting air or normal handling
This commit is contained in:
@@ -402,6 +402,13 @@ public final class GameModeConfig<M, W> {
|
|||||||
*/
|
*/
|
||||||
public final int WaterDepth;
|
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
|
* 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) {
|
private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List<Integer> EnterStages) {
|
||||||
loaded = loader.canLoad();
|
loaded = loader.canLoad();
|
||||||
WaterDepth = loader.getInt("WaterDepth", 0);
|
WaterDepth = loader.getInt("WaterDepth", 0);
|
||||||
|
WaterDamage = loader.getBoolean("WaterDamage", true);
|
||||||
Schem2Border = new Schem2BorderConfig(loader.with("Schem2Border"));
|
Schem2Border = new Schem2BorderConfig(loader.with("Schem2Border"));
|
||||||
SpawnOffset = new SpawnOffsetConfig(loader.with("SpawnOffset"), Size);
|
SpawnOffset = new SpawnOffsetConfig(loader.with("SpawnOffset"), Size);
|
||||||
BorderFromSchematic = loader.getInt("BorderFromSchematic", 21);
|
BorderFromSchematic = loader.getInt("BorderFromSchematic", 21);
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ public class Permanent implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onExplosion(EntityExplodeEvent e) {
|
public void onExplosion(EntityExplodeEvent e) {
|
||||||
if (!(e.getEntity() instanceof TNTPrimed)) return;
|
if (!(e.getEntity() instanceof TNTPrimed)) return;
|
||||||
|
if (!Config.GameModeConfig.Arena.WaterDamage) return;
|
||||||
e.blockList().removeIf(block -> {
|
e.blockList().removeIf(block -> {
|
||||||
if(block.getType() == Material.TNT) {
|
if(block.getType() == Material.TNT) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user