From 23cddab7a3bb515366704e54db6b720e6a7546aa Mon Sep 17 00:00:00 2001 From: Steffion Date: Mon, 5 Aug 2013 00:02:01 +0200 Subject: [PATCH] Created leave command. --- src/nl/Steffion/BlockHunt/Managers/CommandC.java | 8 ++++++++ src/nl/Steffion/BlockHunt/Managers/ConfigC.java | 9 ++++++++- src/nl/Steffion/BlockHunt/Managers/PlayerM.java | 3 ++- src/nl/Steffion/BlockHunt/W.java | 13 ++++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/nl/Steffion/BlockHunt/Managers/CommandC.java b/src/nl/Steffion/BlockHunt/Managers/CommandC.java index eca201f..c1a490a 100644 --- a/src/nl/Steffion/BlockHunt/Managers/CommandC.java +++ b/src/nl/Steffion/BlockHunt/Managers/CommandC.java @@ -50,6 +50,14 @@ public enum CommandC { ConfigC.help_join, 1, W.pluginName + " "), + LEAVE ("BlockHunt%leave_", + "BlockHunt%l_", + new CMDleave(), + ConfigC.commandEnabled_leave, + PermsC.leave, + ConfigC.help_leave, + 1, + W.pluginName + " "), WAND ("BlockHunt%wand_", "BlockHunt%w_", new CMDwand(), diff --git a/src/nl/Steffion/BlockHunt/Managers/ConfigC.java b/src/nl/Steffion/BlockHunt/Managers/ConfigC.java index eda627b..6c1a51c 100644 --- a/src/nl/Steffion/BlockHunt/Managers/ConfigC.java +++ b/src/nl/Steffion/BlockHunt/Managers/ConfigC.java @@ -19,6 +19,7 @@ public enum ConfigC { commandEnabled_help (true, W.config), commandEnabled_reload (true, W.config), commandEnabled_join (true, W.config), + commandEnabled_leave (true, W.config), commandEnabled_wand (true, W.config), commandEnabled_create (true, W.config), commandEnabled_set (true, W.config), @@ -42,6 +43,7 @@ public enum ConfigC { help_help ("%NShows a list of commands.", W.messages), help_reload ("%NReloads all configs.", W.messages), help_join ("%NJoins a " + W.pluginName + " game.", W.messages), + help_leave ("%NLeave a " + W.pluginName + " game.", W.messages), help_wand ("%NGives you the wand selection tool.", W.messages), help_create ("%NCreates an arena from your selection.", W.messages), help_set ("%NOpens a panel to set settings.", W.messages), @@ -56,6 +58,10 @@ public enum ConfigC { normal_reloadedConfigs ("&aReloaded all configs!", W.messages), normal_joinJoinedArena ("%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)", W.messages), + normal_leaveYouLeft ("%NYou left the arena! Thanks for playing ;)!", + W.messages), + normal_leaveLeftArena ("%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)", + W.messages), normal_wandGaveWand ("%NHere you go ;)! &o(Use the %A&o%type%%N&o!)", W.messages), normal_wandSetPosition ("%NSet position %A#%number%%N to location: %pos%.", @@ -64,7 +70,7 @@ public enum ConfigC { W.messages), normal_lobbyArenaIsStarting ("%NThe arena will start in %A%1%%N second(s)!", W.messages), - normal_lobbyArenaStarted ("%NThe arena has been started! The seeker is comming to find you!", + normal_lobbyArenaStarted ("%NThe arena has been started! The seeker is comming to find you in %A%secs%%N second(s)!", W.messages), normal_ingameSeekerChoosen ("%NPlayer %A%seeker%%N has been choosen as seeker!", W.messages), @@ -91,6 +97,7 @@ public enum ConfigC { error_joinWarpsNotSet ("%EThere are no warps set for this arena. Notify the administrator.", W.messages), error_joinArenaIngame ("%EThis game has already started.", W.messages), + error_leaveNotInArena ("%EYou're not in an arena!", W.messages), error_createSelectionFirst ("%EMake a selection first. Use the wand command: %A/" + W.pluginName + " %E.", W.messages), diff --git a/src/nl/Steffion/BlockHunt/Managers/PlayerM.java b/src/nl/Steffion/BlockHunt/Managers/PlayerM.java index 5bae3d8..8380110 100644 --- a/src/nl/Steffion/BlockHunt/Managers/PlayerM.java +++ b/src/nl/Steffion/BlockHunt/Managers/PlayerM.java @@ -19,9 +19,10 @@ public class PlayerM { info (main + "info", PType.ALL), help (main + "help", PType.ALL), reload (main + "reload", PType.MODERATOR), + join (main + "join", PType.PLAYER), + leave (main + "leave", PType.PLAYER), create (main + "create", PType.ADMIN), set (main + "set", PType.MODERATOR), - join (main + "join", PType.PLAYER), setwarp (main + "setwarp", PType.MODERATOR); public String perm; diff --git a/src/nl/Steffion/BlockHunt/W.java b/src/nl/Steffion/BlockHunt/W.java index 0c41b6f..c77e84d 100644 --- a/src/nl/Steffion/BlockHunt/W.java +++ b/src/nl/Steffion/BlockHunt/W.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Random; +import org.bukkit.GameMode; +import org.bukkit.Location; import org.bukkit.entity.Player; - +import org.bukkit.inventory.ItemStack; import pgDev.bukkit.DisguiseCraft.api.DisguiseCraftAPI; import nl.Steffion.BlockHunt.Managers.ConfigM; @@ -32,6 +34,15 @@ public class W { public static ArrayList arenaList = new ArrayList(); public static Random random = new Random(); public static DisguiseCraftAPI dcAPI; + public static HashMap seekertime = new HashMap(); + + public static HashMap pLocation = new HashMap(); + public static HashMap pGameMode = new HashMap(); + public static HashMap pInventory = new HashMap(); + public static HashMap pArmor = new HashMap(); + public static HashMap pEXP = new HashMap(); + public static HashMap pHealth = new HashMap(); + public static HashMap pFood = new HashMap(); public static void newFiles() { ConfigM.setDefaults();