Move mute, reload, and version to the subcommand of /jail
This commit is contained in:
parent
2bea10259c
commit
edb563a9ec
@ -17,13 +17,10 @@ import com.graywolf336.jail.command.commands.JailClearCommand;
|
||||
import com.graywolf336.jail.command.commands.JailClearForceCommand;
|
||||
import com.graywolf336.jail.command.commands.JailCreateCommand;
|
||||
import com.graywolf336.jail.command.commands.JailListCellsCommand;
|
||||
import com.graywolf336.jail.command.commands.JailMuteCommand;
|
||||
import com.graywolf336.jail.command.commands.JailReloadCommand;
|
||||
import com.graywolf336.jail.command.commands.JailRemoveCellCommand;
|
||||
import com.graywolf336.jail.command.commands.JailStopCommand;
|
||||
import com.graywolf336.jail.command.commands.JailTeleInCommand;
|
||||
import com.graywolf336.jail.command.commands.JailTeleOutCommand;
|
||||
import com.graywolf336.jail.command.commands.JailVersionCommand;
|
||||
import com.graywolf336.jail.command.commands.UnHandCuffCommand;
|
||||
import com.graywolf336.jail.command.commands.UnjailCommand;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
@ -156,13 +153,10 @@ public class CommandHandler {
|
||||
load(JailClearForceCommand.class);
|
||||
load(JailCreateCommand.class);
|
||||
load(JailListCellsCommand.class);
|
||||
load(JailMuteCommand.class);
|
||||
load(JailReloadCommand.class);
|
||||
load(JailRemoveCellCommand.class);
|
||||
load(JailStopCommand.class);
|
||||
load(JailTeleInCommand.class);
|
||||
load(JailTeleOutCommand.class);
|
||||
load(JailVersionCommand.class);
|
||||
load(UnHandCuffCommand.class);
|
||||
load(UnjailCommand.class);
|
||||
}
|
||||
|
@ -10,13 +10,18 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
import com.beust.jcommander.ParameterException;
|
||||
|
||||
import com.graywolf336.jail.JailMain;
|
||||
import com.graywolf336.jail.JailManager;
|
||||
import com.graywolf336.jail.command.jcommands.JailFoundation;
|
||||
import com.graywolf336.jail.command.jcommands.ListJails;
|
||||
import com.graywolf336.jail.command.jcommands.JailList;
|
||||
import com.graywolf336.jail.command.jcommands.Mute;
|
||||
import com.graywolf336.jail.command.jcommands.Reload;
|
||||
import com.graywolf336.jail.command.jcommands.Version;
|
||||
import com.graywolf336.jail.command.subcommands.JailCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailListCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailMuteCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailReloadCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailVersionCommand;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
|
||||
public class JailHandler {
|
||||
@ -37,7 +42,10 @@ public class JailHandler {
|
||||
JCommander jc = new JCommander(foundation);
|
||||
|
||||
//Now let's add the subcommands
|
||||
jc.addCommand("list", new ListJails());
|
||||
jc.addCommand("list", new JailList());
|
||||
jc.addCommand("mute", new Mute());
|
||||
jc.addCommand("reload", new Reload());
|
||||
jc.addCommand("version", new Version());
|
||||
|
||||
try {
|
||||
jc.parse(args);
|
||||
@ -152,6 +160,9 @@ public class JailHandler {
|
||||
private void loadCommands() {
|
||||
load(JailCommand.class);
|
||||
load(JailListCommand.class);
|
||||
load(JailMuteCommand.class);
|
||||
load(JailReloadCommand.class);
|
||||
load(JailVersionCommand.class);
|
||||
}
|
||||
|
||||
private void load(Class<? extends Command> c) {
|
||||
|
@ -7,7 +7,7 @@ import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
@Parameters(commandDescription = "Lists all the jails in the system.")
|
||||
public class ListJails {
|
||||
public class JailList {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.graywolf336.jail.command.jcommands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
@Parameters(commandDescription = "Mutes a player who is in jail.")
|
||||
public class Mute {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.graywolf336.jail.command.jcommands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
@Parameters(commandDescription = "Reloads the plugin and data and all.")
|
||||
public class Reload {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.graywolf336.jail.command.jcommands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
@Parameters(commandDescription = "Shows the version of the plugin.")
|
||||
public class Version {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.graywolf336.jail.command.commands;
|
||||
package com.graywolf336.jail.command.subcommands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@ -11,7 +11,7 @@ import com.graywolf336.jail.enums.LangString;
|
||||
maxArgs = 1,
|
||||
minimumArgs = 1,
|
||||
needsPlayer = false,
|
||||
pattern = "jailmute|jmute",
|
||||
pattern = "mute|m",
|
||||
permission = "jail.command.jailmute",
|
||||
usage = "/jail mute <player>"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package com.graywolf336.jail.command.commands;
|
||||
package com.graywolf336.jail.command.subcommands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@ -11,7 +11,7 @@ import com.graywolf336.jail.enums.LangString;
|
||||
maxArgs = 0,
|
||||
minimumArgs = 0,
|
||||
needsPlayer = false,
|
||||
pattern = "jailreload",
|
||||
pattern = "reload|r",
|
||||
permission = "jail.command.jailreload",
|
||||
usage = "/jail reload"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package com.graywolf336.jail.command.commands;
|
||||
package com.graywolf336.jail.command.subcommands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@ -10,7 +10,7 @@ import com.graywolf336.jail.command.CommandInfo;
|
||||
maxArgs = 0,
|
||||
minimumArgs = 0,
|
||||
needsPlayer = false,
|
||||
pattern = "jailversion|jv",
|
||||
pattern = "version|v",
|
||||
permission = "jail.command.jailversion",
|
||||
usage = "/jail version"
|
||||
)
|
Loading…
Reference in New Issue
Block a user