h31ix

Untitled

Jan 22nd, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. package net.h31ix.nas.commands.basics;
  2.  
  3. /*
  4. * NAS for Bukkit
  5. *
  6. * @author H31IX
  7. *
  8. * H31IX.NET
  9. * WWW.NITRATEGAMING.COM
  10. */
  11.  
  12. import org.bukkit.command.Command;
  13. import org.bukkit.command.CommandExecutor;
  14. import org.bukkit.command.CommandSender;
  15. import org.bukkit.entity.Player;
  16. import net.h31ix.nas.Nas;
  17.  
  18. public class CommandHome implements CommandExecutor {
  19. private final Nas plugin;
  20.  
  21. public CommandHome(Nas plugin){
  22. this.plugin = plugin;
  23. }
  24.  
  25. public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args) {
  26. Player player = (Player)cs;
  27. if (cmd.getName().equalsIgnoreCase("home"))
  28. {
  29.  
  30. if (plugin.checkHome(player) == true)
  31. {
  32. if (player.getWorld().getName().equalsIgnoreCase("world_pvp") || player.getWorld().getName().equalsIgnoreCase("world_pvp_nether"))
  33. {
  34. if (!player.hasPermission("nas.tpdelay"))
  35. {
  36. plugin.scheduleTeleportDelay(player, plugin.getHome(player));
  37. }
  38. else
  39. {
  40. player.teleport(plugin.getHome(player));
  41. }
  42. }
  43. else
  44. {
  45. player.teleport(plugin.getHome(player));
  46. }
  47. }
  48. else
  49. {
  50. player.sendMessage("You dont have a home set!");
  51. }
  52. }
  53. else if (cmd.getName().equalsIgnoreCase("sethome"))
  54. {
  55. double x = player.getLocation().getX();
  56. double y = player.getLocation().getY();
  57. double z = player.getLocation().getZ();
  58. plugin.setHome(x, y, z, player);
  59. player.sendMessage("Home set!");
  60. }
  61. System.gc();
  62. return true;
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment