Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.xlite.game;
- import org.bukkit.entity.Player;
- /**
- *
- * @author Tyler(Arravs)
- *
- */
- public class Commands {
- /**
- * Process the command.
- * @param player
- * @param command
- */
- public static void processCommand(Player player, String command) {
- String[] cmd = command.split(" ");
- if (cmd.length == 0)
- return;
- if(player.isOp()) {
- processAdminCommands(player, cmd, command);
- } else {
- processNormal(player, cmd, command);
- }
- }
- /**
- * Process the normal players commands.
- * @param player
- * @param cmd
- * @param command
- */
- private static void processNormal(Player player, String[] cmd,
- String command) {
- }
- /**
- * Process the admins commands.
- * @param player
- * @param cmd
- * @param command
- */
- private static void processAdminCommands(Player player, String[] cmd,
- String command) {
- if(cmd[0].equalsIgnoreCase("kill")) {
- Player target = player.getServer().getPlayer(cmd[1]);
- target.setHealth(0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement