From 96f1da0aefb5cc2c5ab952f65edfc5a3fbad8b7e Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 22 Dec 2021 19:21:17 +0100 Subject: [PATCH] Config Options --- FightSystem_Core/src/config.yml | 3 ++- FightSystem_Core/src/de/steamwar/fightsystem/Config.java | 2 ++ .../de/steamwar/fightsystem/listener/BlockFadeListener.java | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/config.yml b/FightSystem_Core/src/config.yml index 119f225..d64ac04 100644 --- a/FightSystem_Core/src/config.yml +++ b/FightSystem_Core/src/config.yml @@ -41,7 +41,8 @@ Arena: BorderFromSchematic: 12 # defaults to 12 if missing # If ground walkable, teams can walk below the lower arena border during setup GroundWalkable: true # defaults to true if missing - + # Disable snow melt + SnowMelt: false Schematic: # The size of the schematics Size: diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index 7e04187..8e00233 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -69,6 +69,7 @@ public class Config { public static final int PreperationArea; public static final int WaterDepth; public static final boolean GroundWalkable; + public static final boolean SnowMelt; //schematic parameter public static final boolean RanksEnabled; @@ -164,6 +165,7 @@ public class Config { int schem2BorderZ = config.getInt("Arena.Schem2Border.z", 24); PreperationArea = config.getInt("Arena.BorderFromSchematic", 12); GroundWalkable = config.getBoolean("Arena.GroundWalkable", true); + SnowMelt = config.getBoolean("Arena.SnowMelt", false); int schemsizeX = config.getInt("Schematic.Size.x"); int schemsizeY = config.getInt("Schematic.Size.y"); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/BlockFadeListener.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/BlockFadeListener.java index 5a80166..ab16f99 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/BlockFadeListener.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/BlockFadeListener.java @@ -1,6 +1,7 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.ArenaMode; +import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; import org.bukkit.Material; @@ -16,6 +17,7 @@ public class BlockFadeListener implements Listener { @EventHandler public void onBlockFade(BlockFadeEvent event) { + if(!Config.SnowMelt) return; if (event.getBlock().getType() == Material.SNOW_BLOCK || event.getBlock().getType() == Material.SNOW || event.getBlock().getType() == Material.ICE) { event.setCancelled(true); }