Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.leo.chat;
- import com.massivecraft.factions.entity.Faction;
- import com.massivecraft.factions.entity.MPlayer;
- import java.text.DecimalFormat;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import mkremins.fanciful.FancyMessage;
- import nuvemplugins.solaryeconomy.app.SolaryEconomy;
- import nuvemplugins.solaryeconomy.plugin.objetos.Account;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import ru.tehkode.permissions.PermissionUser;
- import ru.tehkode.permissions.bukkit.PermissionsEx;
- public class global implements CommandExecutor {
- public static boolean chat = false;
- public static ArrayList<Player> v = new ArrayList();
- public static HashMap<String, Long> tempo = new HashMap();
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if (!(sender instanceof Player)) {
- sender.sendMessage("§cComando para jogadores.");
- return true;
- } else {
- Player p = (Player)sender;
- if (command.getName().equalsIgnoreCase("v")) {
- if (!p.hasPermission("obyapi.v")) {
- p.sendMessage("§cVocê não tem permissão para utilizar este comando.");
- return true;
- } else {
- Player jogadores;
- Iterator var21;
- if (!v.contains(p)) {
- v.add(p);
- var21 = Bukkit.getServer().getOnlinePlayers().iterator();
- while(var21.hasNext()) {
- jogadores = (Player)var21.next();
- if (!jogadores.hasPermission("obyapi.v")) {
- jogadores.hidePlayer(p);
- }
- }
- p.sendMessage("§aModo INVISIVEL ativado.");
- return true;
- } else {
- v.remove(p);
- p.sendMessage("§cModo INVISIVEL desativado.");
- var21 = Bukkit.getServer().getOnlinePlayers().iterator();
- while(var21.hasNext()) {
- jogadores = (Player)var21.next();
- jogadores.showPlayer(p);
- }
- return true;
- }
- }
- } else {
- MPlayer mp = MPlayer.get(p);
- PermissionUser user = PermissionsEx.getUser(p);
- String prefix = user.getPrefix().replace("&", "§");
- String fac = "";
- if (mp.getFaction().isNone()) {
- fac = "";
- } else if (Main.fa.equals(mp.getFaction().getName())) {
- Faction f = mp.getFaction();
- fac = f.getColor() + "[" + mp.getRole().getPrefix() + f.getColor() + mp.getFactionTag() + "] ";
- } else {
- Faction f = mp.getFaction();
- fac = f.getColor() + "[" + mp.getRole().getPrefix() + f.getColor() + mp.getFactionTag() + "] ";
- }
- if (command.getName().equalsIgnoreCase("g")) {
- if (args.length == 0) {
- p.sendMessage("§cUtilize /g <Mensagem> para enviar uma mensagem para todos.");
- return true;
- }
- if (args.length > 0 && chat && !p.hasPermission("obyapi.staff")) {
- p.sendMessage("§cO chat está desativado.");
- return true;
- }
- StringBuilder sb = new StringBuilder();
- for(int i = 0; i < args.length; ++i) {
- sb.append(args[i]).append(" ");
- }
- String messagem = sb.toString();
- String mensagem = "";
- if (p.hasPermission("obyapi.chatcor")) {
- mensagem = messagem.replace("&", "§");
- } else {
- mensagem = messagem;
- }
- mensagem.replace("§k", " ");
- mensagem.replace("§l", " ");
- mensagem.replace("&l", " ");
- mensagem.replace("&k", " ");
- if (mensagem.startsWith("§k")) {
- return true;
- }
- if (mensagem.startsWith("§l")) {
- return true;
- }
- prefix = user.getPrefix().replace("&", "§") + "§f";
- if (tempo.containsKey(p.getName())) {
- if (!Passou(p)) {
- p.sendMessage(getTempo(p) + "§cpara falar no chat novamente.");
- return true;
- }
- tempo.remove(p.getName());
- }
- Date atual = new Date();
- atual.setSeconds(atual.getSeconds() + 6);
- if (!p.hasPermission("obyapi.staff")) {
- tempo.put(p.getName(), atual.getTime());
- }
- String fac2;
- if (mp.hasFaction()) {
- fac2 = mp.getFactionName();
- } else {
- fac2 = "Nenhuma";
- }
- String mcmmo;
- if (Main.mcmmo.toLowerCase().equals(p.getName().toLowerCase())) {
- mcmmo = "§9[⚒]§7 ";
- } else {
- mcmmo = "§7";
- }
- Iterator var17 = Bukkit.getServer().getOnlinePlayers().iterator();
- while(var17.hasNext()) {
- Player on = (Player)var17.next();
- if (on.isOnline() && on != null && !Toggle.globalmutado.contains(on.getName())) {
- String last = ChatColor.getLastColors(mensagem.toLowerCase());
- String le = last.replace("§", "");
- PermissionUser user1 = PermissionsEx.getUser(p);
- if(user.inGroup("Master")) {
- if (le.equals("")) {
- le = "e";
- }
- } else if(user.inGroup("Gerente")) {
- if (le.equals("")) {
- le = "c";
- }
- } else {
- if (le.equals("")) {
- le = "7";
- }
- }
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- DecimalFormat formato = new DecimalFormat("###,###,###");
- String dinheiro = formato.format(Main.economy.getBalance(p));
- if (mp.hasFaction()) {
- if(user1.inGroup("Master")) {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- } else if(user1.inGroup("Gerente")) {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- }else {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- }
- }else {
- if(user1.inGroup("Master")) {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- } else if(user1.inGroup("Gerente")) {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- } else {
- Account account = SolaryEconomy.economia.getMagnata();
- if(account != null) {
- boolean magnata = account.getName().equals(p.getName());
- if(magnata) {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }else {
- if(Principal.Main.tagContagem.getInt("Jogadores." + p.getName().toLowerCase() + ".tag") >= 17) {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }else {
- (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);
- if (p.hasPermission("obyapi.espaco")) {
- on.sendMessage("");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
- }
- }
- public static boolean Passou(Player p) {
- Date vencimento = new Date((Long)tempo.get(p.getName()));
- Date atual = new Date();
- return atual.after(vencimento);
- }
- public static String getTempo(Player p) {
- Date vencimento = new Date((Long)tempo.get(p.getName()));
- Date atual = new Date();
- long variacao = atual.getTime() - vencimento.getTime();
- long varsegundos = variacao / 1000L % 60L;
- long varminutos = variacao / 60000L % 60L;
- long varhoras = variacao / 3600000L % 24L;
- long vardias = variacao / 86400000L % 7L;
- String segundos = String.valueOf(varsegundos).replaceAll("-", "");
- String minutos = String.valueOf(varminutos).replaceAll("-", "");
- String horas = String.valueOf(varhoras).replaceAll("-", "");
- String dias = String.valueOf(vardias).replaceAll("-", "");
- if (dias.equals("0") && horas.equals("0") && minutos.equals("0")) {
- return "§cVocê precisa aguardar §f" + segundos + "§cs ";
- } else if (dias.equals("0") && horas.equals("0")) {
- return "§cVocê precisa aguardar §f" + minutos + "§cm §f" + segundos + "§cs ";
- } else {
- 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 ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement