Wrote the help text for all commands
This commit is contained in:
parent
e089d8ff12
commit
728674335a
19 changed files with 166 additions and 137 deletions
|
@ -11,8 +11,11 @@ public abstract class ModCommand extends TBMCCommandBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] GetHelpText(String alias){
|
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. "
|
return new String[] {
|
||||||
+ "If you're a dev, write the help text you lazy bastard. -Ali"};
|
"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
|
@Override
|
||||||
|
|
|
@ -16,9 +16,12 @@ public abstract class PlayerCommand extends TBMCCommandBase{
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String[] GetHelpText(String alias){
|
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. "
|
return new String[] {
|
||||||
+ "If you're a mod, ask a dev to write the help text." +
|
"This command doesn't have help text, ask a mod to ask a ",
|
||||||
"If you're a dev, write the help text you lazy bastard. -Ali"};
|
"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"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,9 @@ public class PressAliLink extends PlayerCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
||||||
|
|
||||||
sender.getServer().broadcastMessage(linkList.toString() + "over.");
|
|
||||||
|
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
sender.sendMessage("You must specify a link frequency");
|
sender.sendMessage("You must specify a link frequency");
|
||||||
sender.sendMessage("/pressalilink [frequency]");
|
return false;
|
||||||
}
|
}
|
||||||
for (Link link : linkList) {
|
for (Link link : linkList) {
|
||||||
for (String inputlink : args) {
|
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 <frequency>"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package alisolarflare.components.alilinks.commands;
|
package alisolarflare.components.alilinks.commands;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -9,7 +8,6 @@ import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import alisolarflare.components.PlayerCommand;
|
import alisolarflare.components.PlayerCommand;
|
||||||
import alisolarflare.components.alilinks.entities.Link;
|
import alisolarflare.components.alilinks.entities.Link;
|
||||||
|
@ -51,13 +49,21 @@ public class SetAliLink extends PlayerCommand {
|
||||||
z = Double.parseDouble(args[3]);
|
z = Double.parseDouble(args[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Link link = new Link(frequency, world, x, y, z);
|
Link link = new Link(frequency, world, x, y, z);
|
||||||
linkList.add(link);
|
linkList.add(link);
|
||||||
linkData.add(link.toMap());
|
linkData.add(link.toMap());
|
||||||
saveLinkList();
|
saveLinkList();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
private void saveLinkList(){
|
private void saveLinkList(){
|
||||||
config.set("aliLinkList", linkData);
|
config.set("aliLinkList", linkData);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String[] GetHelpText(String alias){
|
||||||
|
return new String[]{
|
||||||
|
"Usage: /setalilink <frequency> [x] [y] [z]"
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package alisolarflare.components.creativeboundaries.commands;
|
package alisolarflare.components.creativeboundaries.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -9,10 +11,10 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
||||||
|
|
||||||
public class Cbgm0 extends PlayerCommand{
|
public class Cbgm0 extends PlayerCommand{
|
||||||
|
|
||||||
private CreativeBoundariesComponent module;
|
private List<Player> cbCreatives;
|
||||||
|
|
||||||
public Cbgm0(CreativeBoundariesComponent module) {
|
public Cbgm0(CreativeBoundariesComponent component) {
|
||||||
this.module = module;
|
this.cbCreatives = component.cbCreatives;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -24,7 +26,12 @@ public class Cbgm0 extends PlayerCommand{
|
||||||
|
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
module.cbCreatives.remove(player);
|
cbCreatives.remove(player);
|
||||||
return false;
|
return true;
|
||||||
|
}
|
||||||
|
public String[] GetHelpText(String alias){
|
||||||
|
return new String[]{
|
||||||
|
"Creative Boundaries Usage: /cbgm0"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package alisolarflare.components.creativeboundaries.commands;
|
package alisolarflare.components.creativeboundaries.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -15,25 +17,21 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
||||||
|
|
||||||
public class Cbgm1 extends PlayerCommand {
|
public class Cbgm1 extends PlayerCommand {
|
||||||
|
|
||||||
private CreativeBoundariesComponent module;
|
List<Player> cbCreatives;
|
||||||
|
|
||||||
public Cbgm1(CreativeBoundariesComponent module) {
|
public Cbgm1(CreativeBoundariesComponent component) {
|
||||||
this.module = module;
|
this.cbCreatives = component.cbCreatives;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) {
|
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;
|
Player player = (Player) sender;
|
||||||
|
|
||||||
TownBlock tb = TownyUniverse.getTownBlock(player.getLocation());
|
TownBlock tb = TownyUniverse.getTownBlock(player.getLocation());
|
||||||
|
|
||||||
if (tb == null) {
|
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.");
|
player.sendMessage("TownBlock is null.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -41,23 +39,30 @@ public class Cbgm1 extends PlayerCommand {
|
||||||
try {
|
try {
|
||||||
town = tb.getTown();
|
town = tb.getTown();
|
||||||
} catch (NotRegisteredException e) {
|
} catch (NotRegisteredException e) {
|
||||||
player.sendMessage("You aren't standing in a town or some other error occured.");
|
player.sendMessage("You aren't standing in a town, head to your home town to use this command.");
|
||||||
player.sendMessage("TownBlock's town is not registered.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (town == null) {
|
|
||||||
player.sendMessage("ERROR: The town you're standing in is Null.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean playerIsInTown = false;
|
||||||
for(Resident res : town.getResidents()){
|
for(Resident res : town.getResidents()){
|
||||||
if (res.getName().toString().equals(player.getName().toString())){
|
if (res.getName().toString().equals(player.getName().toString())){
|
||||||
player.setGameMode(GameMode.CREATIVE);
|
playerIsInTown = true;
|
||||||
module.cbCreatives.add(player);
|
break;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.sendMessage("Sorry, you're not part of this town");
|
if (!playerIsInTown){
|
||||||
return false;
|
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"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,35 +2,33 @@ package alisolarflare.components.creativeboundaries.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import alisolarflare.components.PlayerCommand;
|
import alisolarflare.components.ModCommand;
|
||||||
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
||||||
|
|
||||||
public class SetDickmode extends PlayerCommand{
|
public class SetDickmode extends ModCommand{
|
||||||
private CreativeBoundariesComponent module;
|
boolean dickMode;
|
||||||
|
|
||||||
public SetDickmode(CreativeBoundariesComponent module){
|
public SetDickmode(CreativeBoundariesComponent component){
|
||||||
this.module = module;
|
this.dickMode = component.dickmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
||||||
if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){
|
if(args.length < 1){
|
||||||
if(args[0] == null){
|
sender.sendMessage("You must use True, False, 1, or 0 as arguments!");
|
||||||
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;
|
|
||||||
}
|
|
||||||
return false;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package alisolarflare.components.creativeboundaries.listeners;
|
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.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryCreativeEvent;
|
|
||||||
|
|
||||||
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
||||||
|
|
||||||
|
@ -16,11 +11,4 @@ public class ItemRestrictionListener implements Listener {
|
||||||
public ItemRestrictionListener(CreativeBoundariesComponent module) {
|
public ItemRestrictionListener(CreativeBoundariesComponent module) {
|
||||||
this.module = module;
|
this.module = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onItemTake(InventoryCreativeEvent event){
|
|
||||||
List<Player> cbCreatives = module.cbCreatives;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package alisolarflare.components.creativeboundaries.listeners;
|
package alisolarflare.components.creativeboundaries.listeners;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -15,27 +17,30 @@ import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||||
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
|
||||||
|
|
||||||
public class PlotChangeListener implements Listener{
|
public class PlotChangeListener implements Listener{
|
||||||
public CreativeBoundariesComponent module;
|
private boolean dickmode;
|
||||||
|
private List<Player> cbCreatives;
|
||||||
|
|
||||||
public PlotChangeListener(CreativeBoundariesComponent module){
|
public PlotChangeListener(CreativeBoundariesComponent module){
|
||||||
this.module = module;
|
this.dickmode = module.dickmode;
|
||||||
|
this.cbCreatives = module.cbCreatives;
|
||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){
|
public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){
|
||||||
Player player = plotEvent.getPlayer();
|
Player player = plotEvent.getPlayer();
|
||||||
if (module.dickmode == false){
|
if (dickmode == false){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){
|
if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){
|
if (!(cbCreatives.contains(plotEvent.getPlayer()))){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TownBlock tb = TownyUniverse.getTownBlock(player.getLocation());
|
TownBlock tb = TownyUniverse.getTownBlock(player.getLocation());
|
||||||
if (tb == null) {
|
if (tb == null) {
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.sendMessage("You have left your town boundaries!");
|
player.sendMessage("You have left your town boundaries!");
|
||||||
module.cbCreatives.remove(player);
|
cbCreatives.remove(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Town town;
|
Town town;
|
||||||
|
@ -44,14 +49,14 @@ public class PlotChangeListener implements Listener{
|
||||||
} catch (NotRegisteredException e) {
|
} catch (NotRegisteredException e) {
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.sendMessage("You have left your town boundaries!!");
|
player.sendMessage("You have left your town boundaries!!");
|
||||||
module.cbCreatives.remove(player);
|
cbCreatives.remove(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (town == null) {
|
if (town == null) {
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.sendMessage("You have left your town boundaries!!!");
|
player.sendMessage("You have left your town boundaries!!!");
|
||||||
module.cbCreatives.remove(player);
|
cbCreatives.remove(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boolean townHasRes = false;
|
boolean townHasRes = false;
|
||||||
|
@ -63,7 +68,7 @@ public class PlotChangeListener implements Listener{
|
||||||
if (!townHasRes){
|
if (!townHasRes){
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.sendMessage("You have left your town boundaries!!!!");
|
player.sendMessage("You have left your town boundaries!!!!");
|
||||||
module.cbCreatives.remove(player);
|
cbCreatives.remove(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,13 @@ public class FlairMe extends PlayerCommand {
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
||||||
PortalListener.playersToBeFlaired.add((Player) sender);
|
PortalListener.playersToBeFlaired.add((Player) sender);
|
||||||
sender.sendMessage("Setup Successful! Walk through a portal to get your flair");
|
sender.sendMessage("Setup Successful! Walk through a portal to get your flair");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetCommandPath() {
|
public String[] GetHelpText(String alias){
|
||||||
return "flairme";
|
return new String[]{
|
||||||
|
"Usage: Type /flairme and enter a portal with coloured",
|
||||||
|
"wool underneath to change your flair"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,6 @@ public class GPower extends PlayerCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
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;
|
Player player = (Player) sender;
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
player.sendMessage("Proper Usage to test G-Powers:");
|
player.sendMessage("Proper Usage to test G-Powers:");
|
||||||
|
@ -32,7 +28,6 @@ public class GPower extends PlayerCommand {
|
||||||
colour = args[0];
|
colour = args[0];
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("error: colour. Proper Usage to configure G-Powers:");
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
boolean isActive;
|
boolean isActive;
|
||||||
|
@ -42,18 +37,22 @@ public class GPower extends PlayerCommand {
|
||||||
isActive = false;
|
isActive = false;
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("error: active. Proper Usage to configure G-Powers:");
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
player.sendMessage("Terms Vaild!");
|
player.sendMessage("Terms Vaild!");
|
||||||
player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive);
|
player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive);
|
||||||
gPowerMemory.configurePlayer(player, colour, isActive);
|
gPowerMemory.configurePlayer(player, colour, isActive);
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetCommandPath() {
|
public String GetCommandPath() {
|
||||||
return "gpower";
|
return "gpower";
|
||||||
}
|
}
|
||||||
|
public String[] GetHelpText(String alias){
|
||||||
|
return new String[]{
|
||||||
|
"Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,11 @@ public class PowerAll extends ModCommand{
|
||||||
for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){
|
for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){
|
||||||
poweredPlayer.isPowersActive = true;
|
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"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,14 @@ public class PowerDown extends PlayerCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
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;
|
Player player = (Player) sender;
|
||||||
gPowerMemory.PowerDownPlayer(player);
|
gPowerMemory.PowerDownPlayer(player);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetCommandPath() {
|
public String[] GetHelpText(String alias){
|
||||||
return "powerdown";
|
return new String[]{
|
||||||
|
"Usage: Type /PowerDown to disable your g-power"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,12 @@ public class PowerUp extends PlayerCommand {
|
||||||
|
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
gPowerMemory.PowerUpPlayer(player);
|
gPowerMemory.PowerUpPlayer(player);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetCommandPath() {
|
public String[] GetHelpText(String alias){
|
||||||
return "powerup";
|
return new String[]{
|
||||||
|
"Usage: Type /PowerUp to activate your registered G-Power"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ public class BoomBowRule extends ModCommand{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (args.length < 2){
|
if (args.length < 2){
|
||||||
player.sendMessage("Usage: /boomBowRule [rulename] [true/false]");
|
|
||||||
player.sendMessage("Rules:");
|
player.sendMessage("Rules:");
|
||||||
player.sendMessage("boomDecay" + boomDecay);
|
player.sendMessage("boomDecay" + boomDecay);
|
||||||
player.sendMessage("healthReduction" + healthReduction);
|
player.sendMessage("healthReduction" + healthReduction);
|
||||||
|
@ -31,7 +30,6 @@ public class BoomBowRule extends ModCommand{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){
|
if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){
|
||||||
player.sendMessage("Usage: /boomBowRule [rulename] [true/false]");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean gameRule = false;
|
boolean gameRule = false;
|
||||||
|
@ -53,21 +51,16 @@ public class BoomBowRule extends ModCommand{
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
player.sendMessage("Error: "+args[0]+" not defined as a rule");
|
player.sendMessage("Error: "+args[0]+" not defined as a rule");
|
||||||
player.sendMessage("Usage: /boomBowRule [rulename] [true/false]");
|
return false;
|
||||||
player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String GetCommandPath() {
|
public String[] GetHelpText(String alias) {
|
||||||
// TODO Auto-generated method stub
|
return new String[]{
|
||||||
return null;
|
"Usage: /boomBowRule [rulename] [true/false]",
|
||||||
}
|
"Rule settings: boomDecay, healthReduction, endCrystal, localized"
|
||||||
@Override
|
};
|
||||||
public String[] GetHelpText(String arg0) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package alisolarflare.components.minigames.commands;
|
package alisolarflare.components.minigames.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import alisolarflare.components.PlayerCommand;
|
import alisolarflare.components.PlayerCommand;
|
||||||
import alisolarflare.components.minigames.MinigameModule;
|
import alisolarflare.components.minigames.MinigameModule;
|
||||||
|
@ -14,16 +13,11 @@ public class JoinMinigame extends PlayerCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
String name = sender.getName();
|
String name = sender.getName();
|
||||||
if (module.fighters.contains(name)) {
|
if (module.fighters.contains(name)) {
|
||||||
sender.sendMessage("You are already in the minigame!");
|
sender.sendMessage("You are already in the minigame!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.fighters.add(name);
|
module.fighters.add(name);
|
||||||
|
@ -31,6 +25,12 @@ public class JoinMinigame extends PlayerCommand {
|
||||||
if (module.fighters.contains(name)) {
|
if (module.fighters.contains(name)) {
|
||||||
sender.sendMessage("You have joined the minigame!");
|
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!"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class LeaveMinigame extends PlayerCommand {
|
||||||
String name = sender.getName();
|
String name = sender.getName();
|
||||||
if (!(module.fighters.contains(name))) {
|
if (!(module.fighters.contains(name))) {
|
||||||
sender.sendMessage("You are not fighting!");
|
sender.sendMessage("You are not fighting!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(module.fighters.contains(name)){
|
while(module.fighters.contains(name)){
|
||||||
|
@ -31,6 +31,12 @@ public class LeaveMinigame extends PlayerCommand {
|
||||||
}
|
}
|
||||||
sender.sendMessage("You have left the fighters category!");
|
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!"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,12 @@ public class ListFighters extends PlayerCommand {
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) {
|
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) {
|
||||||
sender.sendMessage(lobby.fighters.toString());
|
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"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ package alisolarflare.components.minigames.commands;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import alisolarflare.components.PlayerCommand;
|
import alisolarflare.components.ModCommand;
|
||||||
import alisolarflare.components.minigames.data.SpawnSet;
|
import alisolarflare.components.minigames.data.SpawnSet;
|
||||||
|
|
||||||
public class SetColourSpawn extends PlayerCommand{
|
public class SetColourSpawn extends ModCommand{
|
||||||
private SpawnSet spawnSet;
|
private SpawnSet spawnSet;
|
||||||
|
|
||||||
public SetColourSpawn(SpawnSet spawnSet){
|
public SetColourSpawn(SpawnSet spawnSet){
|
||||||
|
@ -14,15 +14,8 @@ public class SetColourSpawn extends PlayerCommand{
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
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;
|
Player player = (Player) sender;
|
||||||
|
|
||||||
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.");
|
sender.sendMessage("ERROR: Arguments required.");
|
||||||
return false;
|
return false;
|
||||||
|
@ -63,6 +56,12 @@ public class SetColourSpawn extends PlayerCommand{
|
||||||
sender.sendMessage("Purple Spawn Set!");
|
sender.sendMessage("Purple Spawn Set!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
|
}
|
||||||
|
public String[] GetHelpText(String alias){
|
||||||
|
return new String[] {
|
||||||
|
"Usage: /SetColourSpawn <colour>",
|
||||||
|
"Colours: red, orange, yellow, green, blue, purple"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue