forked from SteamWar/SteamWar
rename property
This commit is contained in:
@@ -465,7 +465,7 @@ public final class GameModeConfig<M, W> {
|
||||
*
|
||||
* @implSpec {@code empty} by default
|
||||
*/
|
||||
public final Set<M> BlockedFormedBlocks;
|
||||
public final Set<M> DisabledBlockForms;
|
||||
|
||||
/**
|
||||
* Allow leaving the arena area as spectator
|
||||
@@ -488,7 +488,7 @@ public final class GameModeConfig<M, W> {
|
||||
*/
|
||||
public final boolean NoFloor;
|
||||
|
||||
private ArenaConfig(YMLWrapper<M,W> loader, SchematicConfig.SizeConfig Size, List<Integer> EnterStages) {
|
||||
private ArenaConfig(YMLWrapper<M, W> loader, SchematicConfig.SizeConfig Size, List<Integer> EnterStages) {
|
||||
loaded = loader.canLoad();
|
||||
WaterDepth = loader.getInt("WaterDepth", 0);
|
||||
WaterDamage = loader.getBoolean("WaterDamage", true);
|
||||
@@ -497,11 +497,11 @@ public final class GameModeConfig<M, W> {
|
||||
BorderFromSchematic = loader.getInt("BorderFromSchematic", 21);
|
||||
GroundWalkable = loader.getBoolean("GroundWalkable", true);
|
||||
DisableSnowMelt = loader.getBoolean("DisableSnowMelt", false);
|
||||
Set<M> blockedFormedBlocks = new HashSet<>(loader.getMaterialList("BlockedFormedBlocks"));
|
||||
Set<M> disabledBlockForms = new HashSet<>(loader.getMaterialList("DisabledBlockForms"));
|
||||
if (loader.getBoolean("DisableIceForm", false)) {
|
||||
blockedFormedBlocks.add(loader.materialMapper.apply("ICE"));
|
||||
disabledBlockForms.add(loader.materialMapper.apply("ICE"));
|
||||
}
|
||||
BlockedFormedBlocks = Collections.unmodifiableSet(blockedFormedBlocks);
|
||||
DisabledBlockForms = Collections.unmodifiableSet(disabledBlockForms);
|
||||
Leaveable = loader.getBoolean("Leaveable", false);
|
||||
AllowMissiles = loader.getBoolean("AllowMissiles", !EnterStages.isEmpty());
|
||||
NoFloor = loader.getBoolean("NoFloor", false);
|
||||
|
||||
@@ -49,12 +49,15 @@ Arena:
|
||||
# Disable snow and ice melting
|
||||
DisableSnowMelt: false # defaults to false if missing
|
||||
# Disabled blocks from forming
|
||||
BlockedFormedBlocks:
|
||||
DisabledBlockForms:
|
||||
# For Cobble Generators
|
||||
# - COBBLESTONE
|
||||
# - BASALT
|
||||
# - STONE
|
||||
# - OBSIDIAN
|
||||
# Disable ice specifically from forming
|
||||
# Deprecated, add ICE to DisabledBlockForms list instead
|
||||
DisableIceForm: false
|
||||
# Allow leaving the arena area as spectator
|
||||
Leaveable: false # defaults to false if missing
|
||||
# Allow missiles to fly to the enemy and not stop at the schem border.
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ import org.bukkit.event.block.BlockFormEvent;
|
||||
public class BlockFormListener implements Listener {
|
||||
|
||||
public BlockFormListener() {
|
||||
boolean enabled = !Config.GameModeConfig.Arena.BlockedFormedBlocks.isEmpty();
|
||||
boolean enabled = !Config.GameModeConfig.Arena.DisabledBlockForms.isEmpty();
|
||||
new StateDependentListener(enabled, FightState.All, this);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockFormListener implements Listener {
|
||||
if (!Config.ArenaRegion.inRegion(event.getBlock())) return;
|
||||
|
||||
Material material = event.getNewState().getType();
|
||||
if (Config.GameModeConfig.Arena.BlockedFormedBlocks.contains(material)) {
|
||||
if (Config.GameModeConfig.Arena.DisabledBlockForms.contains(material)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user