Advertisement
Felipz10_

Untitled

Dec 11th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. package me.natmanu.net;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7.  
  8. import JSON.JSONChatClickEventTipo.JSONChatClickEventType;
  9. import JSON.JSONChatExtras;
  10. import JSON.JSONChatHoverEventTipo.JSONChatHoverEventType;
  11. import JSON.JSONChatMessage;
  12.  
  13. public class Comandos implements CommandExecutor {
  14.  
  15. @Override
  16. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  17.  
  18. if(sender instanceof Player) {
  19. if (cmd.getName().equalsIgnoreCase("manu")) {
  20.  
  21. if (args.length != 1) {
  22. JSONChatMessage texto = new JSONChatMessage(" ", null, null);
  23. JSONChatExtras um = new JSONChatExtras("\n");
  24. JSONChatExtras dois = new JSONChatExtras("\n");
  25. JSONChatExtras tres = new JSONChatExtras("\n");
  26.  
  27. JSONChatExtras ativar = new JSONChatExtras("§e /manu ativar");
  28. ativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu ativar \n§7 Clique para ativar o modo manutenção do servidor!");
  29. ativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu ativar");
  30. JSONChatExtras desativar = new JSONChatExtras("§e\n§e /manu desativar");
  31. desativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu desativar \n§7 Clique para desativar o modo manutenção do servidor!");
  32. desativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu desativar");
  33. JSONChatExtras tempo = new JSONChatExtras("§e\n§e /manu tempo (segundos) [V2]");
  34. tempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu tempo (segundos) \n §7Disponivel na V2...");
  35. tempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
  36. JSONChatExtras cancelartempo = new JSONChatExtras("§e\n§e /manu cancelar [V2]");
  37. cancelartempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu cancelar \n §7Disponivel na V2...");
  38. cancelartempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
  39. texto.addExtra(dois);
  40. texto.addExtra(ativar);
  41. texto.addExtra(desativar);
  42. texto.addExtra(um);
  43. texto.addExtra(tempo);
  44. texto.addExtra(cancelartempo);
  45. texto.addExtra(tres);
  46.  
  47. texto.sendToPlayer((Player) sender);
  48. return true;
  49. }
  50.  
  51. if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
  52. if(!args[0].equalsIgnoreCase(null)) {
  53.  
  54. JSONChatMessage texto = new JSONChatMessage(" ", null, null);
  55. JSONChatExtras um = new JSONChatExtras("\n");
  56. JSONChatExtras dois = new JSONChatExtras("\n");
  57. JSONChatExtras tres = new JSONChatExtras("\n");
  58.  
  59. JSONChatExtras ativar = new JSONChatExtras("§e /manu ativar");
  60. ativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu ativar \n§7 Clique para ativar o modo manutenção do servidor!");
  61. ativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu ativar");
  62. JSONChatExtras desativar = new JSONChatExtras("§e\n§e /manu desativar");
  63. desativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu desativar \n§7 Clique para desativar o modo manutenção do servidor!");
  64. desativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu desativar");
  65. JSONChatExtras tempo = new JSONChatExtras("§e\n§e /manu tempo (segundos) [V2]");
  66. tempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu tempo (segundos) \n §7Disponivel na V2...");
  67. tempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
  68. JSONChatExtras cancelartempo = new JSONChatExtras("§e\n§e /manu cancelar [V2]");
  69. cancelartempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu cancelar \n §7Disponivel na V2...");
  70. cancelartempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
  71. texto.addExtra(dois);
  72. texto.addExtra(ativar);
  73. texto.addExtra(desativar);
  74. texto.addExtra(um);
  75. texto.addExtra(tempo);
  76. texto.addExtra(cancelartempo);
  77. texto.addExtra(tres);
  78.  
  79. texto.sendToPlayer((Player) sender);
  80. return true;
  81.  
  82. }
  83. }
  84. if (args[0].equalsIgnoreCase("ativar")) {
  85. if(Utilidades.manu==true) {
  86. sender.sendMessage("§cO modo manutenção já está ativado!");
  87. return true;
  88. }else {
  89. Utilidades.manu=true;
  90. sender.sendMessage("§eVocê ativou o modo manutenção!");
  91. return true;
  92. }
  93. }
  94. else if (args[0].equalsIgnoreCase("desativar")) {
  95. if(Utilidades.manu==false) {
  96. sender.sendMessage("§cModo manutenção já está desativado!");
  97. return true;
  98. }else {
  99. Utilidades.manu=false;
  100. sender.sendMessage("§eVocê desativou o modo manutenção!");
  101. return true;
  102. }
  103. }
  104.  
  105.  
  106. }else {
  107. if (cmd.getName().equalsIgnoreCase("manu")) {
  108. if (args.length != 1) {
  109. sender.sendMessage("");
  110. sender.sendMessage("§e /manu ativar");
  111. sender.sendMessage("§e /manu desativar");
  112. sender.sendMessage("");
  113. sender.sendMessage("§e /manu tempo (segundos) [V2]");
  114. sender.sendMessage("§e /manu cancelar [V2]");
  115. sender.sendMessage("");
  116.  
  117. return true;
  118. }
  119.  
  120. if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
  121. if(!args[0].equalsIgnoreCase(null)) {
  122.  
  123. sender.sendMessage("");
  124. sender.sendMessage("§e /manu ativar");
  125. sender.sendMessage("§e /manu desativar");
  126. sender.sendMessage("");
  127. sender.sendMessage("§e /manu tempo (segundos) [V2]");
  128. sender.sendMessage("§e /manu cancelar [V2]");
  129. sender.sendMessage("");
  130. return true;
  131. }
  132. if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
  133. if(!args[2].equalsIgnoreCase(null)) {
  134.  
  135. sender.sendMessage("");
  136. sender.sendMessage("§e /manu ativar");
  137. sender.sendMessage("§e /manu desativar");
  138. sender.sendMessage("");
  139. sender.sendMessage("§e /manu tempo (segundos) [V2]");
  140. sender.sendMessage("§e /manu cancelar [V2]");
  141. sender.sendMessage("");
  142. return true;
  143. }
  144. if (args[0].equalsIgnoreCase("ativar")) {
  145. if(Utilidades.manu==true) {
  146. sender.sendMessage("§cO modo manutenção já está ativado!");
  147. return true;
  148. }else {
  149. Utilidades.manu=true;
  150. sender.sendMessage("§eVocê ativou o modo manutenção!");
  151. return true;
  152. }
  153. }
  154.  
  155. else if (args[0].equalsIgnoreCase("desativar")) {
  156. if(Utilidades.manu==false) {
  157. sender.sendMessage("§cModo manutenção já está desativado!");
  158. return true;
  159. }else {
  160. Utilidades.manu=false;
  161. sender.sendMessage("§eVocê desativou o modo manutenção!");
  162. return true;
  163. }
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. }
  171.  
  172.  
  173. }
  174.  
  175.  
  176. }
  177.  
  178.  
  179. }
  180.  
  181. }
  182.  
  183.  
  184.  
  185. }
  186. return false;
  187. }
  188.  
  189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement