diff --git a/resources/res/settings.yml b/resources/res/settings.yml index e690f09..591b526 100644 --- a/resources/res/settings.yml +++ b/resources/res/settings.yml @@ -37,3 +37,4 @@ auto-ready: false use-class-chests: false display-waves-as-level: false display-timer-as-level: false +use-scoreboards: true diff --git a/src/com/garbagemule/MobArena/ArenaImpl.java b/src/com/garbagemule/MobArena/ArenaImpl.java index 8e086d8..600906b 100644 --- a/src/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/com/garbagemule/MobArena/ArenaImpl.java @@ -45,6 +45,7 @@ import com.garbagemule.MobArena.util.config.ConfigSection; import com.garbagemule.MobArena.util.inventory.InventoryManager; import com.garbagemule.MobArena.util.inventory.InventoryUtils; import com.garbagemule.MobArena.waves.*; +import com.garbagemule.MobArena.ScoreboardManager.NullScoreboardManager; public class ArenaImpl implements Arena { @@ -170,7 +171,7 @@ public class ArenaImpl implements Arena this.timeStrategy = (time != null ? new TimeStrategyLocked(time) : new TimeStrategyNull()); // Scoreboards - this.scoreboard = new ScoreboardManager(this); + this.scoreboard = (settings.getBoolean("use-scoreboards", true) ? new ScoreboardManager(this) : new NullScoreboardManager(this)); } diff --git a/src/com/garbagemule/MobArena/ScoreboardManager.java b/src/com/garbagemule/MobArena/ScoreboardManager.java index c546960..155d1ab 100644 --- a/src/com/garbagemule/MobArena/ScoreboardManager.java +++ b/src/com/garbagemule/MobArena/ScoreboardManager.java @@ -92,4 +92,15 @@ public class ScoreboardManager { kills.setDisplaySlot(DisplaySlot.SIDEBAR); updateWave(0); } + + static class NullScoreboardManager extends ScoreboardManager { + NullScoreboardManager(Arena arena) { + super(arena); + } + void addPlayer(Player player) {} + void removePlayer(Player player) {} + void addKill(Player player) {} + void updateWave(int wave) {} + void initialize() {} + } }