mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Aliased /party chat to work for /partychat and /party teleport to work
for /ptp
This commit is contained in:
parent
51493fab48
commit
bbc2091b77
@ -5,6 +5,7 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.chat.commands.PartyChatCommand;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -30,6 +31,8 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
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();
|
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
|
||||||
|
private CommandExecutor partyTeleportCommand = new PtpCommand();
|
||||||
|
private CommandExecutor partyChatCommand = new PartyChatCommand();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
@ -86,6 +89,10 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
return partyQuitCommand.onCommand(sender, command, label, args);
|
return partyQuitCommand.onCommand(sender, command, label, args);
|
||||||
case INVITE:
|
case INVITE:
|
||||||
return partyInviteCommand.onCommand(sender, command, label, args);
|
return partyInviteCommand.onCommand(sender, command, label, args);
|
||||||
|
case TELEPORT:
|
||||||
|
return partyTeleportCommand.onCommand(sender, command, label, extractArgs(args));
|
||||||
|
case CHAT:
|
||||||
|
return partyChatCommand.onCommand(sender, command, label, extractArgs(args));
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -127,4 +134,14 @@ 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 String[] extractArgs(String[] args) {
|
||||||
|
String[] newArgs = new String[args.length - 1];
|
||||||
|
|
||||||
|
for (int i = 1; i < args.length; i++) {
|
||||||
|
newArgs[i - 1] = args[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return newArgs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,9 @@ public enum PartySubcommand {
|
|||||||
LOCK,
|
LOCK,
|
||||||
UNLOCK,
|
UNLOCK,
|
||||||
PASSWORD,
|
PASSWORD,
|
||||||
RENAME;
|
RENAME,
|
||||||
|
TELEPORT,
|
||||||
|
CHAT;
|
||||||
|
|
||||||
public static PartySubcommand getSubcommand(String commandName) {
|
public static PartySubcommand getSubcommand(String commandName) {
|
||||||
for (PartySubcommand command : values()) {
|
for (PartySubcommand command : values()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user