mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-19 22:12:09 +01:00
Add per-arena setting to enable/disable scoreboards.
This commit is contained in:
parent
97c54855d4
commit
65c5ea05b3
@ -37,3 +37,4 @@ auto-ready: false
|
|||||||
use-class-chests: false
|
use-class-chests: false
|
||||||
display-waves-as-level: false
|
display-waves-as-level: false
|
||||||
display-timer-as-level: false
|
display-timer-as-level: false
|
||||||
|
use-scoreboards: true
|
||||||
|
@ -45,6 +45,7 @@ import com.garbagemule.MobArena.util.config.ConfigSection;
|
|||||||
import com.garbagemule.MobArena.util.inventory.InventoryManager;
|
import com.garbagemule.MobArena.util.inventory.InventoryManager;
|
||||||
import com.garbagemule.MobArena.util.inventory.InventoryUtils;
|
import com.garbagemule.MobArena.util.inventory.InventoryUtils;
|
||||||
import com.garbagemule.MobArena.waves.*;
|
import com.garbagemule.MobArena.waves.*;
|
||||||
|
import com.garbagemule.MobArena.ScoreboardManager.NullScoreboardManager;
|
||||||
|
|
||||||
public class ArenaImpl implements Arena
|
public class ArenaImpl implements Arena
|
||||||
{
|
{
|
||||||
@ -170,7 +171,7 @@ public class ArenaImpl implements Arena
|
|||||||
this.timeStrategy = (time != null ? new TimeStrategyLocked(time) : new TimeStrategyNull());
|
this.timeStrategy = (time != null ? new TimeStrategyLocked(time) : new TimeStrategyNull());
|
||||||
|
|
||||||
// Scoreboards
|
// Scoreboards
|
||||||
this.scoreboard = new ScoreboardManager(this);
|
this.scoreboard = (settings.getBoolean("use-scoreboards", true) ? new ScoreboardManager(this) : new NullScoreboardManager(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,4 +92,15 @@ public class ScoreboardManager {
|
|||||||
kills.setDisplaySlot(DisplaySlot.SIDEBAR);
|
kills.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
updateWave(0);
|
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() {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user