Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.60 KB | None | 0 0
  1. package me.leo.chat;
  2.  
  3. import com.massivecraft.factions.entity.Faction;
  4. import com.massivecraft.factions.entity.MPlayer;
  5. import java.text.DecimalFormat;
  6. import java.util.ArrayList;
  7. import java.util.Date;
  8. import java.util.HashMap;
  9. import java.util.Iterator;
  10. import java.util.List;
  11.  
  12. import mkremins.fanciful.FancyMessage;
  13. import nuvemplugins.solaryeconomy.app.SolaryEconomy;
  14. import nuvemplugins.solaryeconomy.plugin.objetos.Account;
  15.  
  16. import org.bukkit.Bukkit;
  17. import org.bukkit.ChatColor;
  18. import org.bukkit.command.Command;
  19. import org.bukkit.command.CommandExecutor;
  20. import org.bukkit.command.CommandSender;
  21. import org.bukkit.entity.Player;
  22. import ru.tehkode.permissions.PermissionUser;
  23. import ru.tehkode.permissions.bukkit.PermissionsEx;
  24.  
  25. public class global implements CommandExecutor {
  26. public static boolean chat = false;
  27. public static ArrayList<Player> v = new ArrayList();
  28. public static HashMap<String, Long> tempo = new HashMap();
  29.  
  30. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  31. if (!(sender instanceof Player)) {
  32. sender.sendMessage("§cComando para jogadores.");
  33. return true;
  34. } else {
  35. Player p = (Player)sender;
  36. if (command.getName().equalsIgnoreCase("v")) {
  37. if (!p.hasPermission("obyapi.v")) {
  38. p.sendMessage("§cVocê não tem permissão para utilizar este comando.");
  39. return true;
  40. } else {
  41. Player jogadores;
  42. Iterator var21;
  43. if (!v.contains(p)) {
  44. v.add(p);
  45. var21 = Bukkit.getServer().getOnlinePlayers().iterator();
  46.  
  47. while(var21.hasNext()) {
  48. jogadores = (Player)var21.next();
  49. if (!jogadores.hasPermission("obyapi.v")) {
  50. jogadores.hidePlayer(p);
  51. }
  52. }
  53.  
  54. p.sendMessage("§aModo INVISIVEL ativado.");
  55. return true;
  56. } else {
  57. v.remove(p);
  58. p.sendMessage("§cModo INVISIVEL desativado.");
  59. var21 = Bukkit.getServer().getOnlinePlayers().iterator();
  60.  
  61. while(var21.hasNext()) {
  62. jogadores = (Player)var21.next();
  63. jogadores.showPlayer(p);
  64. }
  65.  
  66. return true;
  67. }
  68. }
  69. } else {
  70. MPlayer mp = MPlayer.get(p);
  71. PermissionUser user = PermissionsEx.getUser(p);
  72. String prefix = user.getPrefix().replace("&", "§");
  73. String fac = "";
  74. if (mp.getFaction().isNone()) {
  75. fac = "";
  76. } else if (Main.fa.equals(mp.getFaction().getName())) {
  77. Faction f = mp.getFaction();
  78. fac = f.getColor() + "[" + mp.getRole().getPrefix() + f.getColor() + mp.getFactionTag() + "] ";
  79. } else {
  80. Faction f = mp.getFaction();
  81. fac = f.getColor() + "[" + mp.getRole().getPrefix() + f.getColor() + mp.getFactionTag() + "] ";
  82. }
  83.  
  84. if (command.getName().equalsIgnoreCase("g")) {
  85. if (args.length == 0) {
  86. p.sendMessage("§cUtilize /g <Mensagem> para enviar uma mensagem para todos.");
  87. return true;
  88. }
  89.  
  90. if (args.length > 0 && chat && !p.hasPermission("obyapi.staff")) {
  91. p.sendMessage("§cO chat está desativado.");
  92. return true;
  93. }
  94.  
  95. StringBuilder sb = new StringBuilder();
  96.  
  97. for(int i = 0; i < args.length; ++i) {
  98. sb.append(args[i]).append(" ");
  99. }
  100.  
  101. String messagem = sb.toString();
  102. String mensagem = "";
  103. if (p.hasPermission("obyapi.chatcor")) {
  104. mensagem = messagem.replace("&", "§");
  105. } else {
  106. mensagem = messagem;
  107. }
  108.  
  109. mensagem.replace("§k", " ");
  110. mensagem.replace("§l", " ");
  111. mensagem.replace("&l", " ");
  112. mensagem.replace("&k", " ");
  113. if (mensagem.startsWith("§k")) {
  114. return true;
  115. }
  116.  
  117. if (mensagem.startsWith("§l")) {
  118. return true;
  119. }
  120.  
  121. prefix = user.getPrefix().replace("&", "§") + "§f";
  122. if (tempo.containsKey(p.getName())) {
  123. if (!Passou(p)) {
  124. p.sendMessage(getTempo(p) + "§cpara falar no chat novamente.");
  125. return true;
  126. }
  127.  
  128. tempo.remove(p.getName());
  129. }
  130.  
  131. Date atual = new Date();
  132. atual.setSeconds(atual.getSeconds() + 6);
  133. if (!p.hasPermission("obyapi.staff")) {
  134. tempo.put(p.getName(), atual.getTime());
  135. }
  136.  
  137. String fac2;
  138. if (mp.hasFaction()) {
  139. fac2 = mp.getFactionName();
  140. } else {
  141. fac2 = "Nenhuma";
  142. }
  143.  
  144. String mcmmo;
  145. if (Main.mcmmo.toLowerCase().equals(p.getName().toLowerCase())) {
  146. mcmmo = "§9[⚒]§7 ";
  147. } else {
  148. mcmmo = "§7";
  149. }
  150.  
  151. Iterator var17 = Bukkit.getServer().getOnlinePlayers().iterator();
  152.  
  153. while(var17.hasNext()) {
  154. Player on = (Player)var17.next();
  155. if (on.isOnline() && on != null && !Toggle.globalmutado.contains(on.getName())) {
  156. String last = ChatColor.getLastColors(mensagem.toLowerCase());
  157. String le = last.replace("§", "");
  158.  
  159. PermissionUser user1 = PermissionsEx.getUser(p);
  160.  
  161. if(user.inGroup("Master")) {
  162. if (le.equals("")) {
  163. le = "e";
  164. }
  165. } else if(user.inGroup("Gerente")) {
  166. if (le.equals("")) {
  167. le = "c";
  168. }
  169. } else {
  170. if (le.equals("")) {
  171. le = "7";
  172. }
  173. }
  174. if (p.hasPermission("obyapi.espaco")) {
  175. on.sendMessage("");
  176. }
  177. DecimalFormat formato = new DecimalFormat("###,###,###");
  178. String dinheiro = formato.format(Main.economy.getBalance(p));
  179.  
  180.  
  181. if (mp.hasFaction()) {
  182. if(user1.inGroup("Master")) {
  183. Account account = SolaryEconomy.economia.getMagnata();
  184. if(account != null) {
  185. boolean magnata = account.getName().equals(p.getName());
  186. if(magnata) {
  187. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  188. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  189. if (p.hasPermission("obyapi.espaco")) {
  190. on.sendMessage("");
  191. }
  192. }else {
  193. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  194. if (p.hasPermission("obyapi.espaco")) {
  195. on.sendMessage("");
  196. }
  197. }
  198. }else {
  199. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  200. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  201. if (p.hasPermission("obyapi.espaco")) {
  202. on.sendMessage("");
  203. }
  204. }else {
  205. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  206. if (p.hasPermission("obyapi.espaco")) {
  207. on.sendMessage("");
  208. }
  209. }
  210. }
  211. }
  212. } else if(user1.inGroup("Gerente")) {
  213. Account account = SolaryEconomy.economia.getMagnata();
  214. if(account != null) {
  215. boolean magnata = account.getName().equals(p.getName());
  216. if(magnata) {
  217.  
  218. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  219. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  220. if (p.hasPermission("obyapi.espaco")) {
  221. on.sendMessage("");
  222. }
  223. }else {
  224. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  225. if (p.hasPermission("obyapi.espaco")) {
  226. on.sendMessage("");
  227. }
  228. }
  229.  
  230. }else {
  231. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  232. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  233. if (p.hasPermission("obyapi.espaco")) {
  234. on.sendMessage("");
  235. }
  236. }else {
  237. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  238. if (p.hasPermission("obyapi.espaco")) {
  239. on.sendMessage("");
  240. }
  241. }
  242. }
  243. }
  244. }else {
  245. Account account = SolaryEconomy.economia.getMagnata();
  246. if(account != null) {
  247. boolean magnata = account.getName().equals(p.getName());
  248. if(magnata) {
  249.  
  250. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  251. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  252. if (p.hasPermission("obyapi.espaco")) {
  253. on.sendMessage("");
  254. }
  255. }else {
  256. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).tooltip("§6Facção: §f" + mp.getFactionName() + "\n§6Poder: §f" + (int) mp.getFaction().getPower() + "§f/" + (int) mp.getFaction().getPowerMax() + "\n§6Membros online: §f" + mp.getFaction().getOnlinePlayers().size() + "§f/" +mp.getFaction().getMPlayers().size() + "\n§6Líder: §f" + mp.getFaction().getLeader().getName() + "\n\n§cFacção mais valiosa do servidor.").then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le)).send(on);
  257. if (p.hasPermission("obyapi.espaco")) {
  258. on.sendMessage("");
  259. }
  260. }
  261.  
  262. }else {
  263. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  264. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  265. if (p.hasPermission("obyapi.espaco")) {
  266. on.sendMessage("");
  267. }
  268. }else {
  269. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix + fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "").replaceAll("§k", "").replaceAll("§o", "")).color(ChatColor.getByChar(le.toLowerCase())).send(on);
  270. if (p.hasPermission("obyapi.espaco")) {
  271. on.sendMessage("");
  272. }
  273. }
  274. }
  275. }
  276. }
  277.  
  278. }else {
  279. if(user1.inGroup("Master")) {
  280. Account account = SolaryEconomy.economia.getMagnata();
  281. if(account != null) {
  282. boolean magnata = account.getName().equals(p.getName());
  283. if(magnata) {
  284.  
  285. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  286. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  287. if (p.hasPermission("obyapi.espaco")) {
  288. on.sendMessage("");
  289. }
  290. }else {
  291. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  292. if (p.hasPermission("obyapi.espaco")) {
  293. on.sendMessage("");
  294. }
  295. }
  296. }else {
  297. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  298. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  299. if (p.hasPermission("obyapi.espaco")) {
  300. on.sendMessage("");
  301. }
  302. }else {
  303. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §e" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  304. if (p.hasPermission("obyapi.espaco")) {
  305. on.sendMessage("");
  306. }
  307. }
  308. }
  309.  
  310. }
  311. } else if(user1.inGroup("Gerente")) {
  312. Account account = SolaryEconomy.economia.getMagnata();
  313. if(account != null) {
  314. boolean magnata = account.getName().equals(p.getName());
  315. if(magnata) {
  316.  
  317. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  318. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  319. if (p.hasPermission("obyapi.espaco")) {
  320. on.sendMessage("");
  321. }
  322. }else {
  323. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  324. if (p.hasPermission("obyapi.espaco")) {
  325. on.sendMessage("");
  326. }
  327. }
  328. }else {
  329. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  330. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  331. if (p.hasPermission("obyapi.espaco")) {
  332. on.sendMessage("");
  333. }
  334. }else {
  335. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §c" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  336. if (p.hasPermission("obyapi.espaco")) {
  337. on.sendMessage("");
  338. }
  339. }
  340. }
  341. }
  342. } else {
  343. Account account = SolaryEconomy.economia.getMagnata();
  344. if(account != null) {
  345. boolean magnata = account.getName().equals(p.getName());
  346. if(magnata) {
  347.  
  348. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  349. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  350. if (p.hasPermission("obyapi.espaco")) {
  351. on.sendMessage("");
  352. }
  353. }else {
  354. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§2[$] ").tooltip("§2Jogador mais rico do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  355. if (p.hasPermission("obyapi.espaco")) {
  356. on.sendMessage("");
  357. }
  358. }
  359. }else {
  360. if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
  361. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then("§a[✸] ").tooltip("§aJogador mais viciado do servidor").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  362. if (p.hasPermission("obyapi.espaco")) {
  363. on.sendMessage("");
  364. }
  365. }else {
  366. (new FancyMessage("§6")).color(ChatColor.GOLD).then("§7[G] ").then(mcmmo).tooltip("§9Jogador com mais habilidade do servidor!").then(prefix).then(fac).then("§f" + p.getName()).tooltip("§6Jogador: §f" + p.getName() + "\n§6Facção: §f" + fac2 + "\n§6Poder:§f " + (int)mp.getPower() + "/" + (int)mp.getPowerMax() + "\n§6Coins: §f" + dinheiro).then("§f:").then(" §7" + mensagem.replaceAll("§l", "")).color(ChatColor.getByChar(le)).send(on);
  367. if (p.hasPermission("obyapi.espaco")) {
  368. on.sendMessage("");
  369. }
  370. }
  371. }
  372. }
  373. }
  374. }
  375. }
  376. }
  377. }
  378.  
  379. return false;
  380. }
  381. }
  382. }
  383.  
  384. public static boolean Passou(Player p) {
  385. Date vencimento = new Date((Long)tempo.get(p.getName()));
  386. Date atual = new Date();
  387. return atual.after(vencimento);
  388. }
  389.  
  390. public static String getTempo(Player p) {
  391. Date vencimento = new Date((Long)tempo.get(p.getName()));
  392. Date atual = new Date();
  393. long variacao = atual.getTime() - vencimento.getTime();
  394. long varsegundos = variacao / 1000L % 60L;
  395. long varminutos = variacao / 60000L % 60L;
  396. long varhoras = variacao / 3600000L % 24L;
  397. long vardias = variacao / 86400000L % 7L;
  398. String segundos = String.valueOf(varsegundos).replaceAll("-", "");
  399. String minutos = String.valueOf(varminutos).replaceAll("-", "");
  400. String horas = String.valueOf(varhoras).replaceAll("-", "");
  401. String dias = String.valueOf(vardias).replaceAll("-", "");
  402. if (dias.equals("0") && horas.equals("0") && minutos.equals("0")) {
  403. return "§cVocê precisa aguardar §f" + segundos + "§cs ";
  404. } else if (dias.equals("0") && horas.equals("0")) {
  405. return "§cVocê precisa aguardar §f" + minutos + "§cm §f" + segundos + "§cs ";
  406. } else {
  407. return dias.equals("0") ? "§cVocê precisa aguardar §f" + horas + "§ch §f" + minutos + "§cm §c" + segundos + "§cs " : "§cVocê precisa aguardar §f" + horas + "§ch §f" + minutos + "§cm §f" + segundos + "§cs ";
  408. }
  409. }
  410. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement