Advertisement
mrkirby153

Untitled

Feb 16th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. package me.mrkirby153.swc.core.command;
  2.  
  3. import org.bukkit.Server;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public abstract class BaseCommand {
  10.  
  11.     private transient JavaPlugin plugin;
  12.  
  13.     public void run(final Server server, final Player player, final Command cmd, final String commandLabel, final String[] args) throws CommandException {
  14.         run(server, (CommandSender) player, cmd, commandLabel, args);
  15.     }
  16.  
  17.     public void run(final Server server, final CommandSender sender, final Command cmd, final String commandLabel, final String[] args) throws CommandException {
  18.         throw new CommandException("You must be a player to preform this command!");
  19.     }
  20.  
  21.     public JavaPlugin getPlugin() {
  22.         return plugin;
  23.     }
  24.  
  25.     public void setPlugin(JavaPlugin plugin) {
  26.         this.plugin = plugin;
  27.     }
  28.  
  29.     public boolean isNumber(String number) {
  30.         try {
  31.             float f = Float.parseFloat(number);
  32.         } catch (NumberFormatException e) {
  33.             return false;
  34.         }
  35.         return true;
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement