Advertisement
Guest User

Untitled

a guest
May 26th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. package com.gmail.BurnyDaKath.fwplayerutils;
  2.  
  3.  
  4. import com.avaje.ebeaninternal.server.type.ScalarTypeJodaDateMidnight;
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.WeatherType;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9. import org.bukkit.command.Command;
  10. import org.bukkit.command.CommandSender;
  11.  
  12. public class Main extends JavaPlugin {
  13.  
  14.  
  15. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  16.  
  17.  
  18. if (cmd.getName().equalsIgnoreCase("ptime")) {
  19.  
  20. Player player = (Player) sender;
  21.  
  22. if (args.length != 0) {
  23. sender.sendMessage(ChatColor.RED + "Not Enough Args !");
  24. } else {
  25.  
  26.  
  27. if (args[0].equalsIgnoreCase("day") && sender.hasPermission("FWPU.SetTime")) {
  28. player.setPlayerTime(17000, false);
  29.  
  30. } else if (!sender.hasPermission("FWPU.SetTime")) {
  31. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  32. }
  33.  
  34.  
  35. if (args[0].equalsIgnoreCase("night") && sender.hasPermission("FWPU.SetTime")) {
  36. player.setPlayerTime(6000, false);
  37. } else if (!sender.hasPermission("FWPU.SetTime")) {
  38. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  39. }
  40. }
  41. } //Closes PTime
  42.  
  43.  
  44. if (cmd.getName().equalsIgnoreCase("pweather")) {
  45.  
  46. Player player = (Player) sender;
  47.  
  48. if (args.length != 0) {
  49. sender.sendMessage(ChatColor.RED + "Not Enough Args !");
  50. } else {
  51.  
  52.  
  53. if (args[0].equalsIgnoreCase("clear") && sender.hasPermission("FWPU.SetWeather")) {
  54. player.setPlayerWeather(WeatherType.CLEAR);
  55. sender.sendMessage(ChatColor.BLUE + "FW> Your weather is now set to clear");
  56. } else if (!sender.hasPermission("FWPU.SetWeather")) {
  57. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  58. }
  59.  
  60.  
  61. if (args[0].equalsIgnoreCase("rain") && sender.hasPermission("FWPU.SetWeather")) {
  62. player.setPlayerWeather(WeatherType.DOWNFALL);
  63. sender.sendMessage(ChatColor.BLUE + "FW> Your weather is now set to Rain");
  64. return true;
  65. } else if (!sender.hasPermission("FWPU.SetWeather")) {
  66. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  67. }
  68. }
  69.  
  70. } //Closes PWeather
  71.  
  72. if (cmd.getName().equalsIgnoreCase("resetptime")) {
  73. resetPlayerTime();
  74. sender.sendMessage(ChatColor.BLUE + "FW> Your Time is now synced with the server time.");
  75. } else if (!sender.hasPermission("FWPU.SetWeather")) {
  76. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  77. }
  78.  
  79.  
  80. if (cmd.getName().equalsIgnoreCase("resetpweather")) {
  81. resetPlayerWeather();
  82. sender.sendMessage(ChatColor.BLUE + "FW> Your Weather is now synced with the server time.");
  83. } else if (!sender.hasPermission("FWPU.SetWeather")) {
  84. sender.sendMessage(ChatColor.BLUE + "FW> " + ChatColor.RED + "You cant use this command !");
  85. }
  86. return true;
  87. }
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. private void resetPlayerWeather() {
  95.  
  96. } //closes ^
  97.  
  98. private void resetPlayerTime() {
  99.  
  100. } //closes ^
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110. } //Closes Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement