2014-06-12 10:44:13 -05:00
|
|
|
package com.graywolf336.jail.command.subcommands;
|
|
|
|
|
2015-06-01 21:14:01 -05:00
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
|
|
|
2014-06-12 10:44:13 -05:00
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
|
|
import com.graywolf336.jail.JailManager;
|
|
|
|
import com.graywolf336.jail.command.Command;
|
|
|
|
import com.graywolf336.jail.command.CommandInfo;
|
2014-07-24 21:16:57 -05:00
|
|
|
import com.graywolf336.jail.enums.Lang;
|
2014-06-12 10:44:13 -05:00
|
|
|
|
|
|
|
@CommandInfo(
|
2014-07-27 14:46:25 -05:00
|
|
|
maxArgs = 0,
|
|
|
|
minimumArgs = 0,
|
|
|
|
needsPlayer = false,
|
|
|
|
pattern = "reload",
|
|
|
|
permission = "jail.command.jailreload",
|
|
|
|
usage = "/jail reload"
|
|
|
|
)
|
2014-06-12 10:44:13 -05:00
|
|
|
public class JailReloadCommand implements Command {
|
2014-07-27 14:46:25 -05:00
|
|
|
public boolean execute(JailManager jm, CommandSender sender, String... args) {
|
|
|
|
try {
|
2015-02-13 14:34:38 -06:00
|
|
|
jm.getPlugin().reloadEverything();
|
2014-07-27 14:46:25 -05:00
|
|
|
sender.sendMessage(Lang.PLUGINRELOADED.get());
|
|
|
|
}catch (Exception e) {
|
2015-02-12 21:29:09 -06:00
|
|
|
e.printStackTrace();
|
|
|
|
sender.sendMessage(ChatColor.RED + "Failed to reload due to (see the console): " + e.getMessage());
|
2014-07-27 14:46:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2015-06-01 21:14:01 -05:00
|
|
|
|
|
|
|
public List<String> provideTabCompletions(JailManager jm, CommandSender sender, String... args) throws Exception {
|
|
|
|
//Reloading the plugin doesn't require tab completions
|
|
|
|
return Collections.emptyList();
|
|
|
|
}
|
2014-06-12 10:44:13 -05:00
|
|
|
}
|