From 73bdb7e0bf50ac31567307665f98b73e17804786 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 07:35:25 -0400 Subject: [PATCH] Fully digested ButtonMinigames --- src/alisolarflare/AliPresents.java | 12 ++--- src/alisolarflare/{modules => }/Module.java | 4 +- .../freeforall/Freeforall.java | 29 ----------- .../freeforall/StartMinigame.java | 5 -- .../buttonminigames/hero/Hero.java | 21 -------- .../buttonminigames/lobby/Lobby.java | 25 ---------- .../components/flairdoor/FlairDoorModule.java | 8 +-- .../flairdoor/commands/FlairMe.java | 4 +- .../commands/SetFlairDoorColour.java | 2 +- .../flairdoor/listeners/PortalListener.java | 2 +- .../components/gpowers/GPowerModule.java | 8 +-- .../gpowers/commands/PowerDown.java | 2 +- .../components/gpowers/commands/PowerUp.java | 2 +- .../gpowers/commands/gPowerCommand.java | 4 +- .../components/gpowers/gPowerMemory.java | 2 +- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 2 +- .../components/links/AliLinkModule.java | 10 ++-- .../links/commands/PressAliLink.java | 4 +- .../components/links/commands/SetAliLink.java | 6 +-- .../components/links/entities/Link.java | 4 +- .../links/serializer/Deserializer.java | 4 +- .../links/serializer/Serializer.java | 4 +- .../components/links/tasks/UnpressTask.java | 2 +- .../components/shulker/AliShulkerModule.java | 6 +-- .../shulker/commands/AliShulker.java | 2 +- .../{modules => }/events/uhc/UHCModule.java | 8 +-- .../events/uhc/commands/AddToUHC.java | 4 +- .../events/uhc/commands/StartMatch.java | 6 +-- .../uhc/listeners/MatchCyclingListener.java | 2 +- .../events/uhc/listeners/MatchMainLoop.java | 2 +- .../events/uhc/memory/MatchState.java | 2 +- .../events/uhc/memory/UHCMatch.java | 2 +- .../{modules => }/magic/MagicModule.java | 10 ++-- .../magic/aliarrow/AliArrowListener.java | 2 +- .../magic/aliarrow/AliArrowTask.java | 2 +- .../magic/boombow/BoomBowListener.java | 2 +- .../magic/boombow/BoomBowRule.java | 2 +- .../freeforall/FreeForAllModule.java | 34 +++++++++++++ .../minigames/freeforall/StartMinigame.java | 5 ++ .../freeforall/commands/SetFFAS.java | 50 ++++++++++++------- .../freeforall/data/Data.java | 2 +- .../freeforall/data/SpawnSet.java | 2 +- .../freeforall/entities/Fighter.java | 2 +- .../minigames/lobby/LobbyModule.java | 27 ++++++++++ .../lobby/commands/ButtonFight.java | 20 ++++---- .../lobby/commands/ButtonLeave.java | 22 ++++---- .../lobby/commands/ListFighters.java | 14 +++--- src/alisolarflare/modules/Registerable.java | 11 ---- 49 files changed, 203 insertions(+), 208 deletions(-) rename src/alisolarflare/{modules => }/Module.java (93%) delete mode 100644 src/alisolarflare/buttonminigames/freeforall/Freeforall.java delete mode 100644 src/alisolarflare/buttonminigames/freeforall/StartMinigame.java delete mode 100644 src/alisolarflare/buttonminigames/hero/Hero.java delete mode 100644 src/alisolarflare/buttonminigames/lobby/Lobby.java rename src/alisolarflare/{modules => }/components/flairdoor/FlairDoorModule.java (58%) rename src/alisolarflare/{modules => }/components/flairdoor/commands/FlairMe.java (81%) rename src/alisolarflare/{modules => }/components/flairdoor/commands/SetFlairDoorColour.java (94%) rename src/alisolarflare/{modules => }/components/flairdoor/listeners/PortalListener.java (95%) rename src/alisolarflare/{modules => }/components/gpowers/GPowerModule.java (59%) rename src/alisolarflare/{modules => }/components/gpowers/commands/PowerDown.java (87%) rename src/alisolarflare/{modules => }/components/gpowers/commands/PowerUp.java (87%) rename src/alisolarflare/{modules => }/components/gpowers/commands/gPowerCommand.java (90%) rename src/alisolarflare/{modules => }/components/gpowers/gPowerMemory.java (94%) rename src/alisolarflare/{modules => }/components/gpowers/listeners/gPowerApplyingTask.java (93%) rename src/alisolarflare/{modules => }/components/gpowers/listeners/gPowerListener.java (90%) rename src/alisolarflare/{modules => }/components/links/AliLinkModule.java (66%) rename src/alisolarflare/{modules => }/components/links/commands/PressAliLink.java (87%) rename src/alisolarflare/{modules => }/components/links/commands/SetAliLink.java (92%) rename src/alisolarflare/{modules => }/components/links/entities/Link.java (86%) rename src/alisolarflare/{modules => }/components/links/serializer/Deserializer.java (81%) rename src/alisolarflare/{modules => }/components/links/serializer/Serializer.java (79%) rename src/alisolarflare/{modules => }/components/links/tasks/UnpressTask.java (85%) rename src/alisolarflare/{modules => }/components/shulker/AliShulkerModule.java (59%) rename src/alisolarflare/{modules => }/components/shulker/commands/AliShulker.java (93%) rename src/alisolarflare/{modules => }/events/uhc/UHCModule.java (72%) rename src/alisolarflare/{modules => }/events/uhc/commands/AddToUHC.java (89%) rename src/alisolarflare/{modules => }/events/uhc/commands/StartMatch.java (85%) rename src/alisolarflare/{modules => }/events/uhc/listeners/MatchCyclingListener.java (87%) rename src/alisolarflare/{modules => }/events/uhc/listeners/MatchMainLoop.java (68%) rename src/alisolarflare/{modules => }/events/uhc/memory/MatchState.java (62%) rename src/alisolarflare/{modules => }/events/uhc/memory/UHCMatch.java (91%) rename src/alisolarflare/{modules => }/magic/MagicModule.java (61%) rename src/alisolarflare/{modules => }/magic/aliarrow/AliArrowListener.java (92%) rename src/alisolarflare/{modules => }/magic/aliarrow/AliArrowTask.java (91%) rename src/alisolarflare/{modules => }/magic/boombow/BoomBowListener.java (95%) rename src/alisolarflare/{modules => }/magic/boombow/BoomBowRule.java (94%) create mode 100644 src/alisolarflare/minigames/freeforall/FreeForAllModule.java create mode 100644 src/alisolarflare/minigames/freeforall/StartMinigame.java rename src/alisolarflare/{buttonminigames => minigames}/freeforall/commands/SetFFAS.java (59%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/data/Data.java (60%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/data/SpawnSet.java (91%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/entities/Fighter.java (80%) create mode 100644 src/alisolarflare/minigames/lobby/LobbyModule.java rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ButtonFight.java (65%) rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ButtonLeave.java (62%) rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ListFighters.java (53%) delete mode 100644 src/alisolarflare/modules/Registerable.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index e2f566d..e738436 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,12 +6,12 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.flairdoor.FlairDoorModule; -import alisolarflare.modules.components.gpowers.GPowerModule; -import alisolarflare.modules.components.links.AliLinkModule; -import alisolarflare.modules.components.shulker.AliShulkerModule; -import alisolarflare.modules.events.uhc.UHCModule; -import alisolarflare.modules.magic.MagicModule; +import alisolarflare.components.flairdoor.FlairDoorModule; +import alisolarflare.components.gpowers.GPowerModule; +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.shulker.AliShulkerModule; +import alisolarflare.events.uhc.UHCModule; +import alisolarflare.magic.MagicModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/Module.java similarity index 93% rename from src/alisolarflare/modules/Module.java rename to src/alisolarflare/Module.java index 2284a28..986bb00 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/Module.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; @@ -18,7 +18,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare * */ -public abstract class Module implements Registerable{ +public abstract class Module{ /** * Registers the project, when called by the Main JavaPlugin class that handles * the main plugin. diff --git a/src/alisolarflare/buttonminigames/freeforall/Freeforall.java b/src/alisolarflare/buttonminigames/freeforall/Freeforall.java deleted file mode 100644 index 1d7be0b..0000000 --- a/src/alisolarflare/buttonminigames/freeforall/Freeforall.java +++ /dev/null @@ -1,29 +0,0 @@ -package alisolarflare.buttonminigames.freeforall; - - -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.freeforall.commands.SetFFAS; -import alisolarflare.buttonminigames.freeforall.data.SpawnSet; - -public class Freeforall { - private MainPlugin plugin; - public SpawnSet spawnSet; - private int GameState; - - public Freeforall(MainPlugin plugin){ - this.plugin = plugin; - this.spawnSet = new SpawnSet(); - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - plugin.getCommand("setFFAS").setExecutor(new SetFFAS(plugin, spawnSet)); - } - public int getGameState() {return GameState;} - public void setGameState(int gameState) {GameState = gameState;} -} diff --git a/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java b/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java deleted file mode 100644 index 22a0102..0000000 --- a/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.buttonminigames.freeforall; - -public class StartMinigame { - -} diff --git a/src/alisolarflare/buttonminigames/hero/Hero.java b/src/alisolarflare/buttonminigames/hero/Hero.java deleted file mode 100644 index b7baf5c..0000000 --- a/src/alisolarflare/buttonminigames/hero/Hero.java +++ /dev/null @@ -1,21 +0,0 @@ -package alisolarflare.buttonminigames.hero; - - -import alisolarflare.MainPlugin; - -public class Hero { - @SuppressWarnings("unused") - private MainPlugin plugin; - public Hero(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - } -} diff --git a/src/alisolarflare/buttonminigames/lobby/Lobby.java b/src/alisolarflare/buttonminigames/lobby/Lobby.java deleted file mode 100644 index 9f1f04e..0000000 --- a/src/alisolarflare/buttonminigames/lobby/Lobby.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.buttonminigames.lobby; - -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.lobby.commands.ButtonFight; -import alisolarflare.buttonminigames.lobby.commands.ButtonLeave; -import alisolarflare.buttonminigames.lobby.commands.ListFighters; - -public class Lobby { - private MainPlugin plugin; - public Lobby(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - plugin.getCommand("buttonfight").setExecutor(new ButtonFight(plugin)); - plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(plugin)); - plugin.getCommand("listfighters").setExecutor(new ListFighters(plugin)); - } -} diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java similarity index 58% rename from src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java rename to src/alisolarflare/components/flairdoor/FlairDoorModule.java index 5c30133..981abdd 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.components.flairdoor; +package alisolarflare.components.flairdoor; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.flairdoor.commands.FlairMe; -import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.Module; +import alisolarflare.components.flairdoor.commands.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java similarity index 81% rename from src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java rename to src/alisolarflare/components/flairdoor/commands/FlairMe.java index 320f3f8..548fe9a 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.components.flairdoor.commands; +package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.chat.TBMCCommandBase; public class FlairMe extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java similarity index 94% rename from src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java rename to src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java index 63debd0..4477fb6 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.flairdoor.commands; +package alisolarflare.components.flairdoor.commands; import java.util.Arrays; import java.util.List; diff --git a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java similarity index 95% rename from src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java rename to src/alisolarflare/components/flairdoor/listeners/PortalListener.java index abf5e07..4e86f74 100644 --- a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.flairdoor.listeners; +package alisolarflare.components.flairdoor.listeners; import java.util.AbstractMap; import java.util.ArrayList; diff --git a/src/alisolarflare/modules/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java similarity index 59% rename from src/alisolarflare/modules/components/gpowers/GPowerModule.java rename to src/alisolarflare/components/gpowers/GPowerModule.java index 4f33f40..a73e81e 100644 --- a/src/alisolarflare/modules/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.components.gpowers; +package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.gpowers.commands.gPowerCommand; -import alisolarflare.modules.components.gpowers.listeners.gPowerListener; +import alisolarflare.Module; +import alisolarflare.components.gpowers.commands.gPowerCommand; +import alisolarflare.components.gpowers.listeners.gPowerListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 87% rename from src/alisolarflare/modules/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index b3fd942..d94c407 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 87% rename from src/alisolarflare/modules/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index 4d1ed16..4392bbe 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/components/gpowers/commands/gPowerCommand.java similarity index 90% rename from src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java rename to src/alisolarflare/components/gpowers/commands/gPowerCommand.java index b536a98..2683c91 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/components/gpowers/commands/gPowerCommand.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.gPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class gPowerCommand extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java b/src/alisolarflare/components/gpowers/gPowerMemory.java similarity index 94% rename from src/alisolarflare/modules/components/gpowers/gPowerMemory.java rename to src/alisolarflare/components/gpowers/gPowerMemory.java index afc9208..f37fd7a 100644 --- a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java +++ b/src/alisolarflare/components/gpowers/gPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers; +package alisolarflare.components.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 93% rename from src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index a13a19d..60f2709 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.Color; import org.bukkit.entity.Player; @@ -7,7 +7,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.modules.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.gPowerMemory; public class gPowerApplyingTask extends BukkitRunnable{ diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java similarity index 90% rename from src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/components/gpowers/listeners/gPowerListener.java index 1892244..5ec3780 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java similarity index 66% rename from src/alisolarflare/modules/components/links/AliLinkModule.java rename to src/alisolarflare/components/links/AliLinkModule.java index 07a8a51..5760d93 100644 --- a/src/alisolarflare/modules/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -1,13 +1,13 @@ -package alisolarflare.modules.components.links; +package alisolarflare.components.links; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.links.commands.PressAliLink; -import alisolarflare.modules.components.links.commands.SetAliLink; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.Module; +import alisolarflare.components.links.commands.PressAliLink; +import alisolarflare.components.links.commands.SetAliLink; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCChatAPI; public class AliLinkModule extends Module { diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/components/links/commands/PressAliLink.java similarity index 87% rename from src/alisolarflare/modules/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/links/commands/PressAliLink.java index 0e3e8c4..da21f6d 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/links/commands/PressAliLink.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.links.commands; +package alisolarflare.components.links.commands; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCCommandBase; public class PressAliLink extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/links/commands/SetAliLink.java b/src/alisolarflare/components/links/commands/SetAliLink.java similarity index 92% rename from src/alisolarflare/modules/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/links/commands/SetAliLink.java index 3b3447e..03c4e57 100644 --- a/src/alisolarflare/modules/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/links/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.commands; +package alisolarflare.components.links.commands; import java.util.ArrayList; import java.util.List; @@ -9,8 +9,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.AliLinkModule; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/modules/components/links/entities/Link.java b/src/alisolarflare/components/links/entities/Link.java similarity index 86% rename from src/alisolarflare/modules/components/links/entities/Link.java rename to src/alisolarflare/components/links/entities/Link.java index cd8b075..f55bfc8 100644 --- a/src/alisolarflare/modules/components/links/entities/Link.java +++ b/src/alisolarflare/components/links/entities/Link.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.entities; +package alisolarflare.components.links.entities; import java.io.Serializable; @@ -6,7 +6,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.tasks.UnpressTask; +import alisolarflare.components.links.tasks.UnpressTask; public class Link implements Serializable{ /** diff --git a/src/alisolarflare/modules/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java similarity index 81% rename from src/alisolarflare/modules/components/links/serializer/Deserializer.java rename to src/alisolarflare/components/links/serializer/Deserializer.java index ff4c1fe..ccc161d 100644 --- a/src/alisolarflare/modules/components/links/serializer/Deserializer.java +++ b/src/alisolarflare/components/links/serializer/Deserializer.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.components.links.serializer; +package alisolarflare.components.links.serializer; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.List; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; public class Deserializer{ diff --git a/src/alisolarflare/modules/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java similarity index 79% rename from src/alisolarflare/modules/components/links/serializer/Serializer.java rename to src/alisolarflare/components/links/serializer/Serializer.java index 359e95a..eb1024f 100644 --- a/src/alisolarflare/modules/components/links/serializer/Serializer.java +++ b/src/alisolarflare/components/links/serializer/Serializer.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.components.links.serializer; +package alisolarflare.components.links.serializer; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.util.List; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; public class Serializer { diff --git a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/links/tasks/UnpressTask.java similarity index 85% rename from src/alisolarflare/modules/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/links/tasks/UnpressTask.java index 4eed62a..769f4f1 100644 --- a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/links/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.tasks; +package alisolarflare.components.links.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java b/src/alisolarflare/components/shulker/AliShulkerModule.java similarity index 59% rename from src/alisolarflare/modules/components/shulker/AliShulkerModule.java rename to src/alisolarflare/components/shulker/AliShulkerModule.java index cab720f..ffccad4 100644 --- a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java +++ b/src/alisolarflare/components/shulker/AliShulkerModule.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.shulker; +package alisolarflare.components.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.shulker.commands.AliShulker; +import alisolarflare.Module; +import alisolarflare.components.shulker.commands.AliShulker; import buttondevteam.lib.chat.TBMCChatAPI; public class AliShulkerModule extends Module { diff --git a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java b/src/alisolarflare/components/shulker/commands/AliShulker.java similarity index 93% rename from src/alisolarflare/modules/components/shulker/commands/AliShulker.java rename to src/alisolarflare/components/shulker/commands/AliShulker.java index 252ccf5..1b4a4da 100644 --- a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java +++ b/src/alisolarflare/components/shulker/commands/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.shulker.commands; +package alisolarflare.components.shulker.commands; import org.bukkit.Location; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java similarity index 72% rename from src/alisolarflare/modules/events/uhc/UHCModule.java rename to src/alisolarflare/events/uhc/UHCModule.java index 550c21b..4e27b57 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.events.uhc; +package alisolarflare.events.uhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.Module; +import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCChatAPI; public class UHCModule extends Module { diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/events/uhc/commands/AddToUHC.java similarity index 89% rename from src/alisolarflare/modules/events/uhc/commands/AddToUHC.java rename to src/alisolarflare/events/uhc/commands/AddToUHC.java index 13bf168..ba51a83 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/events/uhc/commands/AddToUHC.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.events.uhc.commands; +package alisolarflare.events.uhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java b/src/alisolarflare/events/uhc/commands/StartMatch.java similarity index 85% rename from src/alisolarflare/modules/events/uhc/commands/StartMatch.java rename to src/alisolarflare/events/uhc/commands/StartMatch.java index e576556..513c23d 100644 --- a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/events/uhc/commands/StartMatch.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.events.uhc.commands; +package alisolarflare.events.uhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.events.uhc.memory.MatchState; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.events.uhc.memory.MatchState; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class StartMatch extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java b/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java similarity index 87% rename from src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java rename to src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java index 53d5949..892eb07 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java +++ b/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.listeners; +package alisolarflare.events.uhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java b/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java similarity index 68% rename from src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java rename to src/alisolarflare/events/uhc/listeners/MatchMainLoop.java index e44d372..5fc3887 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java +++ b/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.listeners; +package alisolarflare.events.uhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/modules/events/uhc/memory/MatchState.java b/src/alisolarflare/events/uhc/memory/MatchState.java similarity index 62% rename from src/alisolarflare/modules/events/uhc/memory/MatchState.java rename to src/alisolarflare/events/uhc/memory/MatchState.java index 8f65034..8425f71 100644 --- a/src/alisolarflare/modules/events/uhc/memory/MatchState.java +++ b/src/alisolarflare/events/uhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.memory; +package alisolarflare.events.uhc.memory; public enum MatchState { NULL, IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END diff --git a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java b/src/alisolarflare/events/uhc/memory/UHCMatch.java similarity index 91% rename from src/alisolarflare/modules/events/uhc/memory/UHCMatch.java rename to src/alisolarflare/events/uhc/memory/UHCMatch.java index 9cf2323..de42cf8 100644 --- a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/events/uhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.memory; +package alisolarflare.events.uhc.memory; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/modules/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java similarity index 61% rename from src/alisolarflare/modules/magic/MagicModule.java rename to src/alisolarflare/magic/MagicModule.java index e89ff5f..628bef8 100644 --- a/src/alisolarflare/modules/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.magic; +package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.magic.aliarrow.AliArrowListener; -import alisolarflare.modules.magic.boombow.BoomBowListener; +import alisolarflare.Module; +import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.magic.aliarrow.AliArrowListener; +import alisolarflare.magic.boombow.BoomBowListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java b/src/alisolarflare/magic/aliarrow/AliArrowListener.java similarity index 92% rename from src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java rename to src/alisolarflare/magic/aliarrow/AliArrowListener.java index 5c678d7..a7617a8 100644 --- a/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/magic/aliarrow/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.aliarrow; +package alisolarflare.magic.aliarrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java b/src/alisolarflare/magic/aliarrow/AliArrowTask.java similarity index 91% rename from src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java rename to src/alisolarflare/magic/aliarrow/AliArrowTask.java index 11451c5..f131ace 100644 --- a/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/magic/aliarrow/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.aliarrow; +package alisolarflare.magic.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/modules/magic/boombow/BoomBowListener.java b/src/alisolarflare/magic/boombow/BoomBowListener.java similarity index 95% rename from src/alisolarflare/modules/magic/boombow/BoomBowListener.java rename to src/alisolarflare/magic/boombow/BoomBowListener.java index 86b6e06..9b5ad69 100644 --- a/src/alisolarflare/modules/magic/boombow/BoomBowListener.java +++ b/src/alisolarflare/magic/boombow/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.boombow; +package alisolarflare.magic.boombow; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/magic/boombow/BoomBowRule.java b/src/alisolarflare/magic/boombow/BoomBowRule.java similarity index 94% rename from src/alisolarflare/modules/magic/boombow/BoomBowRule.java rename to src/alisolarflare/magic/boombow/BoomBowRule.java index 7b7c493..aae9a76 100644 --- a/src/alisolarflare/modules/magic/boombow/BoomBowRule.java +++ b/src/alisolarflare/magic/boombow/BoomBowRule.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.boombow; +package alisolarflare.magic.boombow; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java new file mode 100644 index 0000000..070ccf9 --- /dev/null +++ b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java @@ -0,0 +1,34 @@ +package alisolarflare.minigames.freeforall; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.minigames.freeforall.commands.SetFFAS; +import alisolarflare.minigames.freeforall.data.SpawnSet; +import buttondevteam.lib.chat.TBMCChatAPI; + +public class FreeForAllModule extends Module{ + public SpawnSet spawnSet; + private int GameState; + + @Override + public void register(JavaPlugin plugin) { + registerEvents(); + registerCommands(plugin); + registerMemory(); + } + + private void registerEvents() { + } + + private void registerCommands(JavaPlugin plugin) { + TBMCChatAPI.AddCommands(plugin, SetFFAS.class); + } + private void registerMemory() { + this.spawnSet = new SpawnSet(); + } + public int getGameState() {return GameState;} + public void setGameState(int gameState) {GameState = gameState;} + + +} diff --git a/src/alisolarflare/minigames/freeforall/StartMinigame.java b/src/alisolarflare/minigames/freeforall/StartMinigame.java new file mode 100644 index 0000000..1017cae --- /dev/null +++ b/src/alisolarflare/minigames/freeforall/StartMinigame.java @@ -0,0 +1,5 @@ +package alisolarflare.minigames.freeforall; + +public class StartMinigame { + +} diff --git a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java b/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java similarity index 59% rename from src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java rename to src/alisolarflare/minigames/freeforall/commands/SetFFAS.java index 760ba83..56e7a17 100644 --- a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java +++ b/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java @@ -1,43 +1,35 @@ -package alisolarflare.buttonminigames.freeforall.commands; +package alisolarflare.minigames.freeforall.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.freeforall.data.SpawnSet; +import alisolarflare.minigames.freeforall.data.SpawnSet; +import buttondevteam.lib.chat.TBMCCommandBase; -public class SetFFAS implements CommandExecutor{ +public class SetFFAS extends TBMCCommandBase{ private SpawnSet spawnSet; public SetFFAS(SpawnSet spawnSet){ this.spawnSet = spawnSet; } - @SuppressWarnings("deprecation") @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("ERROR: You must be a Alisolarflare and playing to use this command!"); - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("ERROR: You must be a player to use this command!"); + Player player = (Player) sender; - if(!(player.getName().equalsIgnoreCase("Alisolarflare"))){ + if(!(player.getName().equalsIgnoreCase("Alisolarflare"))) player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); - } - if(args.length <= 0){ + + if(args.length == 0){ sender.sendMessage("ERROR: Arguments required."); return false; } String input = args[0]; - if(input == null){ - sender.sendMessage("ERROR: Arguments are null"); - return false; - } - input.toLowerCase(); switch(input){ case ("r"): @@ -73,5 +65,25 @@ public class SetFFAS implements CommandExecutor{ } return false; } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return "setFFAS"; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } } diff --git a/src/alisolarflare/buttonminigames/freeforall/data/Data.java b/src/alisolarflare/minigames/freeforall/data/Data.java similarity index 60% rename from src/alisolarflare/buttonminigames/freeforall/data/Data.java rename to src/alisolarflare/minigames/freeforall/data/Data.java index c537b74..29ad380 100644 --- a/src/alisolarflare/buttonminigames/freeforall/data/Data.java +++ b/src/alisolarflare/minigames/freeforall/data/Data.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.data; +package alisolarflare.minigames.freeforall.data; public class Data { public SpawnSet spawnset; diff --git a/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java b/src/alisolarflare/minigames/freeforall/data/SpawnSet.java similarity index 91% rename from src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java rename to src/alisolarflare/minigames/freeforall/data/SpawnSet.java index 8871a88..79d29de 100644 --- a/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java +++ b/src/alisolarflare/minigames/freeforall/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.data; +package alisolarflare.minigames.freeforall.data; import org.bukkit.Location; diff --git a/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java b/src/alisolarflare/minigames/freeforall/entities/Fighter.java similarity index 80% rename from src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java rename to src/alisolarflare/minigames/freeforall/entities/Fighter.java index 7963aee..98aea3a 100644 --- a/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java +++ b/src/alisolarflare/minigames/freeforall/entities/Fighter.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.entities; +package alisolarflare.minigames.freeforall.entities; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java new file mode 100644 index 0000000..27416bf --- /dev/null +++ b/src/alisolarflare/minigames/lobby/LobbyModule.java @@ -0,0 +1,27 @@ +package alisolarflare.minigames.lobby; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.minigames.lobby.commands.ButtonFight; +import alisolarflare.minigames.lobby.commands.ButtonLeave; +import alisolarflare.minigames.lobby.commands.ListFighters; + +public class LobbyModule extends Module{ + public List fighters; + + public void register(JavaPlugin plugin){ + registerEvents(); + registerCommands(plugin); + } + private void registerEvents() { + } + + private void registerCommands(JavaPlugin plugin) { + plugin.getCommand("buttonfight").setExecutor(new ButtonFight(this)); + plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(this)); + plugin.getCommand("listfighters").setExecutor(new ListFighters(this)); + } +} diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java similarity index 65% rename from src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java rename to src/alisolarflare/minigames/lobby/commands/ButtonFight.java index 18abeda..373af3e 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java @@ -1,17 +1,19 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ButtonFight implements CommandExecutor{ - private MainPlugin plugin; - public ButtonFight(MainPlugin initPlugin){ - plugin = initPlugin; + private LobbyModule lobby; + + public ButtonFight(LobbyModule lobby) { + this.lobby = lobby; } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { @@ -23,15 +25,15 @@ public class ButtonFight implements CommandExecutor{ Player player = (Player) sender; player.sendMessage(player.toString()); - - if(plugin.fighters.contains(player)){ + String name = player.getName(); + if(lobby.fighters.contains(name)){ player.sendMessage("You are already in the button fight!"); return false; } - plugin.fighters.add(player); + lobby.fighters.add(name); - if(plugin.fighters.contains(player)){ + if(lobby.fighters.contains(name)){ player.sendMessage("You have joined the fighters category!"); } return false; diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java similarity index 62% rename from src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java rename to src/alisolarflare/minigames/lobby/commands/ButtonLeave.java index 840517c..5ff3f59 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java @@ -1,18 +1,21 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ButtonLeave implements CommandExecutor{ - private MainPlugin plugin; - public ButtonLeave(MainPlugin initPlugin){ - plugin = initPlugin; - } + + private LobbyModule lobby; + + public ButtonLeave(LobbyModule lobby) { + this.lobby = lobby; + } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { if(!(sender instanceof Player)){ @@ -21,12 +24,13 @@ public class ButtonLeave implements CommandExecutor{ } Player player = (Player) sender; - if (!(plugin.fighters.contains(player))){ + String name = player.getName(); + if (!(lobby.fighters.contains(name))){ player.sendMessage("You are not fighting!"); return false; } - plugin.fighters.remove(player); - if(!(plugin.fighters.contains(player))){ + lobby.fighters.remove(name); + if(!(lobby.fighters.contains(name))){ player.sendMessage("You have left the fighters category!"); } return false; diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java b/src/alisolarflare/minigames/lobby/commands/ListFighters.java similarity index 53% rename from src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java rename to src/alisolarflare/minigames/lobby/commands/ListFighters.java index 1532c4b..3931d13 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java +++ b/src/alisolarflare/minigames/lobby/commands/ListFighters.java @@ -1,19 +1,21 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ListFighters implements CommandExecutor{ - private MainPlugin plugin; - public ListFighters(MainPlugin initPlugin){ - plugin = initPlugin; + private LobbyModule lobby; + + public ListFighters(LobbyModule lobby) { + this.lobby = lobby; } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - sender.sendMessage(plugin.fighters.toString()); + sender.sendMessage(lobby.fighters.toString()); return false; } diff --git a/src/alisolarflare/modules/Registerable.java b/src/alisolarflare/modules/Registerable.java deleted file mode 100644 index 052a4e9..0000000 --- a/src/alisolarflare/modules/Registerable.java +++ /dev/null @@ -1,11 +0,0 @@ -package alisolarflare.modules; - -import org.bukkit.plugin.java.JavaPlugin; - -/** - * Allows the project to be registered by any Main JavaPlugin class, by calling //modulename.register(this) - * in any JavaPlugin class. - */ -public interface Registerable { - public void register(JavaPlugin plugin); -}