h31ix

Untitled

Jan 10th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. package net.h31ix.nas.commands.world;
  2.  
  3. /*
  4. * NAS for Bukkit
  5. *
  6. * @author H31IX
  7. *
  8. * H31IX.NET
  9. * WWW.NITRATEGAMING.COM
  10. */
  11.  
  12. import org.bukkit.ChatColor;
  13. import org.bukkit.command.Command;
  14. import org.bukkit.command.CommandExecutor;
  15. import org.bukkit.command.CommandSender;
  16. import org.bukkit.entity.Player;
  17.  
  18. public class CommandWeather implements CommandExecutor {
  19.  
  20. public CommandWeather(){
  21. }
  22.  
  23. public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args) {
  24. Player player = (Player)cs;
  25. if (cmd.getName().equalsIgnoreCase("weather"))
  26. {
  27. if (player.hasPermission("nas.weather"))
  28. {
  29. if (args.length == 1)
  30. {
  31. if (args[0].equalsIgnoreCase("Sun"))
  32. {
  33. player.getWorld().setStorm(false);
  34. player.getWorld().setThundering(false);
  35. player.sendMessage("Set world: "+ChatColor.GREEN+player.getWorld().getName()+ChatColor.WHITE+" to sunny.");
  36. }
  37. else if (args[0].equalsIgnoreCase("Rain"))
  38. {
  39. player.getWorld().setStorm(true);
  40. player.sendMessage("Set world: "+ChatColor.GREEN+player.getWorld().getName()+ChatColor.WHITE+" to rainy.");
  41. }
  42. else if (args[0].equalsIgnoreCase("Thunder"))
  43. {
  44. player.getWorld().setThundering(true);
  45. player.sendMessage("Set world: "+ChatColor.GREEN+player.getWorld().getName()+ChatColor.WHITE+" to thundering.");
  46. }
  47. else
  48. {
  49. player.sendMessage("Usage: /weather [sun/rain/thunder]");
  50. }
  51. }
  52. else
  53. {
  54. player.sendMessage("Usage: /weather [sun/rain/thunder]");
  55. }
  56. }
  57. else
  58. {
  59. player.sendMessage("Insufficient permissisons!");
  60. }
  61. }
  62. return true;
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment