From 728674335a24b0fdcb842e1ed7dbcb69c2e1c262 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 13 Nov 2016 17:00:00 -0500 Subject: [PATCH] Wrote the help text for all commands --- src/alisolarflare/components/ModCommand.java | 7 ++- .../components/PlayerCommand.java | 9 ++-- .../alilinks/commands/PressAliLink.java | 14 ++++-- .../alilinks/commands/SetAliLink.java | 10 +++- .../creativeboundaries/commands/Cbgm0.java | 17 +++++-- .../creativeboundaries/commands/Cbgm1.java | 47 ++++++++++--------- .../commands/SetDickmode.java | 40 ++++++++-------- .../listeners/ItemRestrictionListener.java | 12 ----- .../listeners/PlotChangeListener.java | 21 +++++---- .../flairdoor/commands/FlairMe.java | 10 ++-- .../components/gpowers/commands/GPower.java | 13 +++-- .../components/gpowers/commands/PowerAll.java | 7 ++- .../gpowers/commands/PowerDown.java | 11 ++--- .../components/gpowers/commands/PowerUp.java | 9 ++-- .../components/magic/tricks/BoomBowRule.java | 21 +++------ .../minigames/commands/JoinMinigame.java | 18 +++---- .../minigames/commands/LeaveMinigame.java | 10 +++- .../minigames/commands/ListFighters.java | 8 +++- .../minigames/commands/SetColourSpawn.java | 19 ++++---- 19 files changed, 166 insertions(+), 137 deletions(-) diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index c359349..ebe15f8 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -11,8 +11,11 @@ public abstract class ModCommand extends TBMCCommandBase{ @Override public String[] GetHelpText(String alias){ - return new String[] {"This command doesn't have help text, ask a dev to add one, using public String[] GetHelpText. " - + "If you're a dev, write the help text you lazy bastard. -Ali"}; + return new String[] { + "This command doesn't have help text, ask a dev to add one", + " using public String[] GetHelpText. ", + "If you're a dev, write the help text you lazy bastard. -Ali" + }; } @Override diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index e3bfae5..5b32d24 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -16,9 +16,12 @@ public abstract class PlayerCommand extends TBMCCommandBase{ } @Override public String[] GetHelpText(String alias){ - return new String[] {"This command doesn't have help text, ask a mod to ask a dev to add one, using public String[] GetHelpText. " - + "If you're a mod, ask a dev to write the help text." + - "If you're a dev, write the help text you lazy bastard. -Ali"}; + return new String[] { + "This command doesn't have help text, ask a mod to ask a ", + "dev to add one using public String[] GetHelpText. ", + "If you're a mod, ask a dev to write the help text.", + "If you're a dev, write the help text you lazy bastard. -Ali" + }; } } diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index eeeee96..0f2b0ba 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -19,12 +19,9 @@ public class PressAliLink extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(linkList.toString() + "over."); - if (args.length < 1) { sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); + return false; } for (Link link : linkList) { for (String inputlink : args) { @@ -33,6 +30,13 @@ public class PressAliLink extends PlayerCommand { } } } - return false; + sender.sendMessage("Link pressed!"); + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /pressalilink " + }; } } diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index c68aa18..11ffb83 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -1,6 +1,5 @@ package alisolarflare.components.alilinks.commands; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -9,7 +8,6 @@ import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.PlayerCommand; import alisolarflare.components.alilinks.entities.Link; @@ -51,13 +49,21 @@ public class SetAliLink extends PlayerCommand { z = Double.parseDouble(args[3]); } } + Link link = new Link(frequency, world, x, y, z); linkList.add(link); linkData.add(link.toMap()); saveLinkList(); + return true; } private void saveLinkList(){ config.set("aliLinkList", linkData); } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /setalilink [x] [y] [z]" + }; + } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 2551d68..b1e597b 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.commands; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -9,10 +11,10 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm0 extends PlayerCommand{ - private CreativeBoundariesComponent module; + private List cbCreatives; - public Cbgm0(CreativeBoundariesComponent module) { - this.module = module; + public Cbgm0(CreativeBoundariesComponent component) { + this.cbCreatives = component.cbCreatives; } @Override @@ -24,7 +26,12 @@ public class Cbgm0 extends PlayerCommand{ Player player = (Player) sender; player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; + cbCreatives.remove(player); + return true; + } + public String[] GetHelpText(String alias){ + return new String[]{ + "Creative Boundaries Usage: /cbgm0" + }; } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index 9767dd3..845de5e 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.commands; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -15,25 +17,21 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm1 extends PlayerCommand { - private CreativeBoundariesComponent module; + List cbCreatives; - public Cbgm1(CreativeBoundariesComponent module) { - this.module = module; + public Cbgm1(CreativeBoundariesComponent component) { + this.cbCreatives = component.cbCreatives; } @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } + Player player = (Player) sender; - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("Some error occured."); player.sendMessage("TownBlock is null."); return false; } @@ -41,23 +39,30 @@ public class Cbgm1 extends PlayerCommand { try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); + player.sendMessage("You aren't standing in a town, head to your home town to use this command."); return false; } + boolean playerIsInTown = false; for(Resident res : town.getResidents()){ if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; + playerIsInTown = true; + break; } } - player.sendMessage("Sorry, you're not part of this town"); - return false; + if (!playerIsInTown){ + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + player.setGameMode(GameMode.CREATIVE); + cbCreatives.add(player); + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: When in a town that you either own or are a resident of, type /cbgm1 to gain creative" + }; } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index 8650dd1..134ffb0 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -2,35 +2,33 @@ package alisolarflare.components.creativeboundaries.commands; import org.bukkit.command.CommandSender; -import alisolarflare.components.PlayerCommand; +import alisolarflare.components.ModCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; -public class SetDickmode extends PlayerCommand{ - private CreativeBoundariesComponent module; +public class SetDickmode extends ModCommand{ + boolean dickMode; - public SetDickmode(CreativeBoundariesComponent module){ - this.module = module; + public SetDickmode(CreativeBoundariesComponent component){ + this.dickMode = component.dickmode; } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if(args.length < 1){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); return false; } + String firstArgument = args[0]; + if(firstArgument.startsWith("t") || firstArgument.equals("1")){ + sender.sendMessage("Dickmode has been turned on!"); + dickMode = true; + return true; + } + if(firstArgument.startsWith("f") || firstArgument.equals("0")){ + sender.sendMessage("Dickmode has been turned off!"); + dickMode = false; + return true; + } return false; } } diff --git a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java index acb431b..8b09d5a 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,11 +1,6 @@ package alisolarflare.components.creativeboundaries.listeners; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; @@ -16,11 +11,4 @@ public class ItemRestrictionListener implements Listener { public ItemRestrictionListener(CreativeBoundariesComponent module) { this.module = module; } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - } diff --git a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index 2516b4e..856cf90 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.listeners; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -15,27 +17,30 @@ import com.palmergames.bukkit.towny.object.TownyUniverse; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class PlotChangeListener implements Listener{ - public CreativeBoundariesComponent module; + private boolean dickmode; + private List cbCreatives; + public PlotChangeListener(CreativeBoundariesComponent module){ - this.module = module; + this.dickmode = module.dickmode; + this.cbCreatives = module.cbCreatives; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ + if (dickmode == false){ return; } if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ return; } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + if (!(cbCreatives.contains(plotEvent.getPlayer()))){ return; } TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } Town town; @@ -44,14 +49,14 @@ public class PlotChangeListener implements Listener{ } catch (NotRegisteredException e) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } if (town == null) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } boolean townHasRes = false; @@ -63,7 +68,7 @@ public class PlotChangeListener implements Listener{ if (!townHasRes){ player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); } } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index cceaaf3..8654260 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -12,11 +12,13 @@ public class FlairMe extends PlayerCommand { public boolean OnCommand(CommandSender sender, String label, String[] args) { PortalListener.playersToBeFlaired.add((Player) sender); sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - return false; + return true; } - @Override - public String GetCommandPath() { - return "flairme"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /flairme and enter a portal with coloured", + "wool underneath to change your flair" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index bfd8ce5..3a2561d 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -16,10 +16,6 @@ public class GPower extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } Player player = (Player) sender; if (args.length < 2) { player.sendMessage("Proper Usage to test G-Powers:"); @@ -32,7 +28,6 @@ public class GPower extends PlayerCommand { colour = args[0]; } else { player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); return false; } boolean isActive; @@ -42,18 +37,22 @@ public class GPower extends PlayerCommand { isActive = false; } else { player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } player.sendMessage("Terms Vaild!"); player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); gPowerMemory.configurePlayer(player, colour, isActive); - return false; + return true; } @Override public String GetCommandPath() { return "gpower"; } + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" + }; + } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/commands/PowerAll.java index a6fafe2..e69874a 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/commands/PowerAll.java @@ -17,6 +17,11 @@ public class PowerAll extends ModCommand{ for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ poweredPlayer.isPowersActive = true; } - return false; + return true; + } + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerAll to activate all powers for all players with gpowers" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java index 42ca6c0..1dbe47b 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -16,15 +16,14 @@ public class PowerDown extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); Player player = (Player) sender; gPowerMemory.PowerDownPlayer(player); - return false; + return true; } - @Override - public String GetCommandPath() { - return "powerdown"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerDown to disable your g-power" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 433ac32..00de691 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -21,11 +21,12 @@ public class PowerUp extends PlayerCommand { Player player = (Player) sender; gPowerMemory.PowerUpPlayer(player); - return false; + return true; } - @Override - public String GetCommandPath() { - return "powerup"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerUp to activate your registered G-Power" + }; } } diff --git a/src/alisolarflare/components/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java index 9d9d9c0..44cea27 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -22,7 +22,6 @@ public class BoomBowRule extends ModCommand{ return false; } if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); player.sendMessage("Rules:"); player.sendMessage("boomDecay" + boomDecay); player.sendMessage("healthReduction" + healthReduction); @@ -31,7 +30,6 @@ public class BoomBowRule extends ModCommand{ return false; } if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); return false; } boolean gameRule = false; @@ -53,21 +51,16 @@ public class BoomBowRule extends ModCommand{ break; default: player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; + return false; } - return false; + return true; } @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; + public String[] GetHelpText(String alias) { + return new String[]{ + "Usage: /boomBowRule [rulename] [true/false]", + "Rule settings: boomDecay, healthReduction, endCrystal, localized" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index 88a5cb0..304c407 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,7 +1,6 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; import alisolarflare.components.minigames.MinigameModule; @@ -14,16 +13,11 @@ public class JoinMinigame extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { String name = sender.getName(); if (module.fighters.contains(name)) { sender.sendMessage("You are already in the minigame!"); - return false; + return true; } module.fighters.add(name); @@ -31,6 +25,12 @@ public class JoinMinigame extends PlayerCommand { if (module.fighters.contains(name)) { sender.sendMessage("You have joined the minigame!"); } - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /JoinMinigame to join a current button minigame!" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index 3685433..a05199f 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -23,7 +23,7 @@ public class LeaveMinigame extends PlayerCommand { String name = sender.getName(); if (!(module.fighters.contains(name))) { sender.sendMessage("You are not fighting!"); - return false; + return true; } while(module.fighters.contains(name)){ @@ -31,6 +31,12 @@ public class LeaveMinigame extends PlayerCommand { } sender.sendMessage("You have left the fighters category!"); - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /LeaveMinigame to leave the current minigame!" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index f0d1738..acf2a67 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -15,6 +15,12 @@ public class ListFighters extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { sender.sendMessage(lobby.fighters.toString()); - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /ListFighters to get the list of fighters in the current minigame" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java index eb44a5d..5582fec 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -3,10 +3,10 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.components.ModCommand; import alisolarflare.components.minigames.data.SpawnSet; -public class SetColourSpawn extends PlayerCommand{ +public class SetColourSpawn extends ModCommand{ private SpawnSet spawnSet; public SetColourSpawn(SpawnSet spawnSet){ @@ -14,15 +14,8 @@ public class SetColourSpawn extends PlayerCommand{ } @Override 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"))) - player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); - - if(args.length == 0){ sender.sendMessage("ERROR: Arguments required."); return false; @@ -63,6 +56,12 @@ public class SetColourSpawn extends PlayerCommand{ sender.sendMessage("Purple Spawn Set!"); break; } - return false; + return true; + } + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: /SetColourSpawn ", + "Colours: red, orange, yellow, green, blue, purple" + }; } }