mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Convert /party help to a subcommand
This commit is contained in:
parent
8cd9942be6
commit
5d693c5d8f
@ -29,6 +29,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand();
|
private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand();
|
||||||
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
|
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
|
||||||
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
|
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
|
||||||
|
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
@ -67,7 +68,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
case CREATE:
|
case CREATE:
|
||||||
return partyCreateCommand.onCommand(sender, command, label, args);
|
return partyCreateCommand.onCommand(sender, command, label, args);
|
||||||
case HELP:
|
case HELP:
|
||||||
return printHelp();
|
return partyHelpCommand.onCommand(sender, command, label, args);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -126,15 +127,4 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
player.sendMessage(LocaleLoader.getString("Party.Help.2", "/party ?"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.2", "/party ?"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean printHelp() {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.3", "/party join", "/party quit"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.1", "/party create"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.4", "/party <lock|unlock>"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.5", "/party password"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.6", "/party kick"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.7", "/party owner"));
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Help.8", "/party disband"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.gmail.nossr50.party.commands;
|
||||||
|
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
|
public class PartyHelpCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
switch (args.length) {
|
||||||
|
case 1:
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.3", "/party join", "/party quit"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.1", "/party create"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.4", "/party <lock|unlock>"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.5", "/party password"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.6", "/party kick"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.7", "/party owner"));
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Party.Help.8", "/party disband"));
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "help"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user