Advertisement
Guest User

Untitled

a guest
Jul 30th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. package me.xlite.game;
  2.  
  3. import org.bukkit.entity.Player;
  4. /**
  5. *
  6. * @author Tyler(Arravs)
  7. *
  8. */
  9. public class Commands {
  10. /**
  11. * Process the command.
  12. * @param player
  13. * @param command
  14. */
  15. public static void processCommand(Player player, String command) {
  16. String[] cmd = command.split(" ");
  17. if (cmd.length == 0)
  18. return;
  19. if(player.isOp()) {
  20. processAdminCommands(player, cmd, command);
  21. } else {
  22. processNormal(player, cmd, command);
  23. }
  24.  
  25. }
  26. /**
  27. * Process the normal players commands.
  28. * @param player
  29. * @param cmd
  30. * @param command
  31. */
  32. private static void processNormal(Player player, String[] cmd,
  33. String command) {
  34.  
  35.  
  36. }
  37. /**
  38. * Process the admins commands.
  39. * @param player
  40. * @param cmd
  41. * @param command
  42. */
  43. private static void processAdminCommands(Player player, String[] cmd,
  44. String command) {
  45. if(cmd[0].equalsIgnoreCase("kill")) {
  46. Player target = player.getServer().getPlayer(cmd[1]);
  47. target.setHealth(0);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement