From 27f73ae61f100c34ceb2dc4e98e4a115e30782c5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 02:40:25 -0500 Subject: [PATCH] Subcommanded all the commands --- plugin.yml | 2 +- src/buttondevteam/alipresents/AliPresents.java | 4 ++-- .../architecture/commands/PlayerCommand.java | 6 ++++-- .../FlairColourAPI.java} | 4 ++-- .../FlairColourComponent.java} | 18 +++++++++--------- .../letterdyes/GetLetterDye.java | 2 +- .../letterdyes/LetterDye.java | 2 +- .../letterdyes/LetterDyeListener.java | 6 +++--- .../portals/FlairMe.java | 10 +++++----- .../portals/PlayerProximityLoop.java | 8 ++++---- .../portals/PortalListener.java | 14 +++++++------- .../portals/SetProximityLocation.java | 7 ++++++- .../components/gpower/powerstate/PowerAll.java | 4 ++++ .../gpower/powerstate/PowerDown.java | 5 +++++ .../components/gpower/powerstate/PowerUp.java | 4 ++++ 15 files changed, 58 insertions(+), 38 deletions(-) rename src/buttondevteam/alipresents/components/{flaircolouring/FlairColouringAPI.java => flaircolour/FlairColourAPI.java} (96%) rename src/buttondevteam/alipresents/components/{flaircolouring/FlairColouringComponent.java => flaircolour/FlairColourComponent.java} (60%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/GetLetterDye.java (84%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/LetterDye.java (86%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/LetterDyeListener.java (83%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/FlairMe.java (67%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/PlayerProximityLoop.java (87%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/PortalListener.java (76%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/SetProximityLocation.java (86%) diff --git a/plugin.yml b/plugin.yml index 33b77f6..3e396be 100644 --- a/plugin.yml +++ b/plugin.yml @@ -11,7 +11,7 @@ commands: description: creates creative boundaries debug: description: debug commands - flaircolouring: + flaircolour: description: flaaairs fruit: description: fruits diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index 6092cf5..dcc752c 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -9,7 +9,7 @@ import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; @@ -27,7 +27,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); - new FlairColouringComponent().register(this); + new FlairColourComponent().register(this); new FruitComponent().register(this); new GPowerComponent().register(this); new InsuranceComponent().register(this); diff --git a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index fa0282d..df0b997 100644 --- a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -7,12 +7,14 @@ import org.bukkit.entity.Player; public abstract class PlayerCommand extends BaseCommand{ /**replaces CommandExecutor functionality*/ @Override - public boolean onCommand(CommandSender commandSender, Command command, String string, String[] args){ - return OnCommand(commandSender, string, args); + public boolean onCommand(CommandSender sender, Command command, String string, String[] args){ + sender.sendMessage("activating" + string.toString()); + return OnCommand(sender, string, args); } /**replaces TBMCCommandBase functionality*/ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args){ + sender.sendMessage("activating" + alias.toString()); return OnCommand((Player) sender, alias, args); } public abstract boolean OnCommand(Player player, String alias, String[] args); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java similarity index 96% rename from src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java rename to src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java index 91a2bba..24dcd6f 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java +++ b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java @@ -1,10 +1,10 @@ -package buttondevteam.alipresents.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolour; import org.bukkit.DyeColor; import com.earth2me.essentials.User; -public class FlairColouringAPI { +public class FlairColourAPI { public static void recolourPlayer(User user, DyeColor dyecolour){ String name = user._getNickname(); String sanitizedName = ""; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java b/src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java similarity index 60% rename from src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java rename to src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java index 04b6575..d8f0485 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java +++ b/src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolour; import java.util.ArrayList; import java.util.List; @@ -13,15 +13,15 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.GetLetterDye; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDye; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDyeListener; -import buttondevteam.alipresents.components.flaircolouring.portals.FlairMe; -import buttondevteam.alipresents.components.flaircolouring.portals.PlayerProximityLoop; -import buttondevteam.alipresents.components.flaircolouring.portals.PortalListener; -import buttondevteam.alipresents.components.flaircolouring.portals.SetProximityLocation; +import buttondevteam.alipresents.components.flaircolour.letterdyes.GetLetterDye; +import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDye; +import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDyeListener; +import buttondevteam.alipresents.components.flaircolour.portals.FlairMe; +import buttondevteam.alipresents.components.flaircolour.portals.PlayerProximityLoop; +import buttondevteam.alipresents.components.flaircolour.portals.PortalListener; +import buttondevteam.alipresents.components.flaircolour.portals.SetProximityLocation; -public class FlairColouringComponent extends Component { +public class FlairColourComponent extends Component { public List playersToBeFlaired = new ArrayList(); @Override public void register(JavaPlugin plugin) { diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java similarity index 84% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java index e88153b..95597ff 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.entity.Player; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java similarity index 86% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java index 0c3cf0d..fa29f60 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java similarity index 83% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java index 0e20ba9..7668acb 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -12,7 +12,7 @@ import org.bukkit.material.Dye; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; +import buttondevteam.alipresents.components.flaircolour.FlairColourAPI; public class LetterDyeListener implements Listener{ private Essentials essentials; @@ -32,7 +32,7 @@ public class LetterDyeListener implements Listener{ Dye dye = (Dye) event.getItem().getData(); User user = essentials.getUser(event.getPlayer()); - user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); + user.setNickname(FlairColourAPI.colourShiftRight(user._getNickname(), dye.getColor())); }catch(Exception e){ event.getPlayer().sendMessage(e.getStackTrace().toString()); } diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java similarity index 67% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java index e14ddb8..b72ff55 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java @@ -1,18 +1,18 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class FlairMe extends PlayerCommand { @Override public String GetCommandPath() { - return "flaircolouring flairme"; + return "flaircolour flairme"; } - private FlairColouringComponent component; - public FlairMe(FlairColouringComponent flairDoorComponent) { + private FlairColourComponent component; + public FlairMe(FlairColourComponent flairDoorComponent) { this.component = flairDoorComponent; } @Override diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java similarity index 87% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java index d038db5..f21ffe9 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -6,11 +6,11 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static JavaPlugin plugin; - private static FlairColouringComponent component; + private static FlairColourComponent component; private static Location startLocation; private static Location endLocation; @@ -21,7 +21,7 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static int eY; private static int eZ; - public PlayerProximityLoop(JavaPlugin plugin, FlairColouringComponent component) { + public PlayerProximityLoop(JavaPlugin plugin, FlairColourComponent component) { PlayerProximityLoop.plugin = plugin; PlayerProximityLoop.component = component; this.runTaskTimer(plugin, 0, 20); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java similarity index 76% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java index 89151c9..0e5b2c1 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.Bukkit; import org.bukkit.DyeColor; @@ -13,17 +13,17 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourAPI; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class PortalListener implements Listener{ public JavaPlugin plugin; Essentials essentials; - private FlairColouringComponent component; + private FlairColourComponent component; - public PortalListener(JavaPlugin plugin, FlairColouringComponent component) { + public PortalListener(JavaPlugin plugin, FlairColourComponent component) { this.plugin = plugin; this.component = component; this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); @@ -51,7 +51,7 @@ public class PortalListener implements Listener{ Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block if(HigherBlock.getType() == Material.STONE){ - FlairColouringAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); + FlairColourAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); component.playersToBeFlaired.remove(player.getName()); return; } @@ -67,7 +67,7 @@ public class PortalListener implements Listener{ return; } - FlairColouringAPI.recolourPlayer(essentials.getUser(player), woolColour); + FlairColourAPI.recolourPlayer(essentials.getUser(player), woolColour); component.playersToBeFlaired.remove(player.getName()); } diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java similarity index 86% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java index 51fb0bc..2f6b910 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.entity.Player; @@ -36,4 +36,9 @@ public class SetProximityLocation extends ModCommand{ "change their colour state." }; } + @Override + public String GetCommandPath() { + return "flaircolour setproximitylocation"; + } + } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java index 2da86db..f1093ab 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java @@ -16,4 +16,8 @@ public class PowerAll extends ModCommand{ "Usage: Type /PowerAll to activate all powers for all players with gpowers" }; } + @Override + public String GetCommandPath() { + return "gpower powerall"; + } } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java index 4f60034..a1404f5 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java @@ -17,4 +17,9 @@ public class PowerDown extends PlayerCommand { "Usage: Type /PowerDown to disable your g-power" }; } + + @Override + public String GetCommandPath() { + return "gpower powerdown"; + } } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java index b3d7f96..46baa89 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java @@ -17,4 +17,8 @@ public class PowerUp extends PlayerCommand { "Usage: Type /PowerUp to activate your registered G-Power" }; } + @Override + public String GetCommandPath() { + return "gpower powerup"; + } }