From 95fdf1295e36c267a32d2964c6ff3eea4c41592b Mon Sep 17 00:00:00 2001 From: Georgiy Date: Sun, 30 Jun 2013 22:29:19 -0400 Subject: [PATCH] Added stopAllParties() --- src/gibstick/bukkit/discosheep/DiscoSheep.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 3fe3bcd..22d3185 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -20,9 +20,7 @@ public final class DiscoSheep extends JavaPlugin { @Override public void onDisable() { - for (String key:getPartyMap().keySet()) { - stopParty(key); - } + this.stopAllParties(); } public Map getPartyMap() { @@ -38,6 +36,12 @@ public final class DiscoSheep extends JavaPlugin { this.getParty(name).stopDisco(); } } + + public void stopAllParties(){ + for(DiscoParty party :this.parties.values()){ + party.stopDisco(); + } + } public boolean hasParty(String name) { return this.parties.containsKey(name);