From db953285c5f1e4997887b0110d9b9dac2c906934 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Mon, 10 Jun 2013 10:43:03 +0200 Subject: [PATCH] Add per-arena setting 'auto-ready'. --- resources/plugin.yml | 2 +- resources/res/settings.yml | 1 + src/com/garbagemule/MobArena/ArenaImpl.java | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/plugin.yml b/resources/plugin.yml index 84c41be..5635161 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -1,7 +1,7 @@ name: MobArena author: garbagemule main: com.garbagemule.MobArena.MobArena -version: 0.94.4.98.3 +version: 0.94.4.98.4 softdepend: [Spout,Towny,Heroes,MagicSpells,Vault] commands: ma: diff --git a/resources/res/settings.yml b/resources/res/settings.yml index 8738fe5..58e51fe 100644 --- a/resources/res/settings.yml +++ b/resources/res/settings.yml @@ -33,5 +33,6 @@ spout-class-select: false player-time-in-arena: world auto-ignite-tnt: false auto-start-timer: 0 +auto-ready: false use-class-chests: false display-waves-as-level: false diff --git a/src/com/garbagemule/MobArena/ArenaImpl.java b/src/com/garbagemule/MobArena/ArenaImpl.java index 1f17fce..4dcf225 100644 --- a/src/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/com/garbagemule/MobArena/ArenaImpl.java @@ -948,6 +948,14 @@ public class ArenaImpl implements Arena arenaPlayer.setArenaClass(arenaClass); arenaClass.grantItems(p); + + if (settings.getBoolean("auto-ready", false)) { + if (autoStartTimer.getRemaining() <= 0) { + playerReady(p); + } else { + readyPlayers.add(p); + } + } } @Override