Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minenite.warzairdrops;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- public class CommandsClass
- implements CommandExecutor
- {
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equalsIgnoreCase("ad")) {
- if (!sender.isOp()) {
- sender.sendMessage(ChatColor.RED + "You must be an OP if you wish to access these commands.");
- return true;
- }
- if (args.length == 0) {
- sender.sendMessage(ChatColor.AQUA + "AirDrops Plus Commands list:");
- sender.sendMessage(ChatColor.GOLD + "/ad interval [minutes]");
- sender.sendMessage(ChatColor.GOLD + "/ad world [worldname]");
- sender.sendMessage(ChatColor.GOLD + "/ad disable");
- sender.sendMessage(ChatColor.GOLD + "/ad enable");
- } else if (args.length == 1) {
- if (args[0].toString().equals("disable")) {
- MainClass.enabled = Boolean.valueOf(false);
- sender.sendMessage(ChatColor.RED + "Airdrops have been disabled!");
- } else if (args[0].toString().equals("enable")) {
- MainClass.enabled = Boolean.valueOf(true);
- sender.sendMessage(ChatColor.RED + "Airdrops have been enabled!");
- }
- } else if (args.length == 2) {
- if (args[0].toString().equals("interval")) {
- String interString = args[1].toString();
- Integer interInt = Integer.valueOf(Integer.parseInt(interString));
- MainClass.plugin.getConfig().set("TimeBetweenDropsMinutes", interInt);
- MainClass.TBD = interInt;
- MainClass.plugin.saveConfig();
- MainClass.plugin.reloadConfig();
- sender.sendMessage(ChatColor.RED + "Airdrop interval has been set to " + interInt);
- }
- else if (args[0].toString().equals("world")) {
- String worldString = args[1].toString();
- MainClass.plugin.getConfig().set("dropWorld", worldString);
- MainClass.dropWorld = worldString;
- MainClass.plugin.saveConfig();
- MainClass.plugin.reloadConfig();
- sender.sendMessage(ChatColor.RED + "Airdrop world has been set to " + worldString);
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment