Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.redewally.manager;
- import com.comphenix.protocol.ProtocolLibrary;
- import com.comphenix.protocol.ProtocolManager;
- import com.redewally.manager.api.Prefixos;
- import com.redewally.manager.api.Tablist;
- import com.redewally.manager.api.Title;
- import com.redewally.manager.cash.Cash;
- import com.redewally.manager.cash.CashCommand;
- import com.redewally.manager.chat.Chat;
- import com.redewally.manager.chat.CommandChat;
- import com.redewally.manager.chat.CommandGlobal;
- import com.redewally.manager.clearlag.Manager;
- import com.redewally.manager.clearlag.MobLimiter;
- import com.redewally.manager.commands.CommandAPI;
- import com.redewally.manager.commands.CommandAnuncio;
- import com.redewally.manager.commands.CommandBack;
- import com.redewally.manager.commands.CommandBunker;
- import com.redewally.manager.commands.CommandChapeu;
- import com.redewally.manager.commands.CommandChatVIP;
- import com.redewally.manager.commands.CommandChunk;
- import com.redewally.manager.commands.CommandCompactar;
- import com.redewally.manager.commands.CommandCraft;
- import com.redewally.manager.commands.CommandDeus;
- import com.redewally.manager.commands.CommandDia;
- import com.redewally.manager.commands.CommandEnchant;
- import com.redewally.manager.commands.CommandEnderChest;
- import com.redewally.manager.commands.CommandEsconder;
- import com.redewally.manager.commands.CommandFertilizar;
- import com.redewally.manager.commands.CommandGerais;
- import com.redewally.manager.commands.CommandGive;
- import com.redewally.manager.commands.CommandHead;
- import com.redewally.manager.commands.CommandHeal;
- import com.redewally.manager.commands.CommandItemInfo;
- import com.redewally.manager.commands.CommandKick;
- import com.redewally.manager.commands.CommandKill;
- import com.redewally.manager.commands.CommandKit;
- import com.redewally.manager.commands.CommandLimpar;
- import com.redewally.manager.commands.CommandLimparChat;
- import com.redewally.manager.commands.CommandLuz;
- import com.redewally.manager.commands.CommandMemory;
- import com.redewally.manager.commands.CommandMobstack;
- import com.redewally.manager.commands.CommandNoite;
- import com.redewally.manager.commands.CommandOlharInventario;
- import com.redewally.manager.commands.CommandPing;
- import com.redewally.manager.commands.CommandPromote;
- import com.redewally.manager.commands.CommandReiniciar;
- import com.redewally.manager.commands.CommandReparar;
- import com.redewally.manager.commands.CommandReportar;
- import com.redewally.manager.commands.CommandRocket;
- import com.redewally.manager.commands.CommandSairComEstilo;
- import com.redewally.manager.commands.CommandSpawn;
- import com.redewally.manager.commands.CommandSpeed;
- import com.redewally.manager.commands.CommandStaff;
- import com.redewally.manager.commands.CommandTeleportar;
- import com.redewally.manager.commands.CommandTell;
- import com.redewally.manager.commands.CommandTitle;
- import com.redewally.manager.commands.CommandTop;
- import com.redewally.manager.commands.CommandTpa;
- import com.redewally.manager.commands.CommandTpall;
- import com.redewally.manager.commands.CommandUptime;
- import com.redewally.manager.commands.CommandVIP;
- import com.redewally.manager.events.ActionInfo;
- import com.redewally.manager.events.AntiJigsaw;
- import com.redewally.manager.events.CapirotoListener;
- import com.redewally.manager.events.DeusListener;
- import com.redewally.manager.events.EsconderListener;
- import com.redewally.manager.events.IPListener;
- import com.redewally.manager.events.Listeners;
- import com.redewally.manager.events.NoStack;
- import com.redewally.manager.events.PreloginListener;
- import com.redewally.manager.events.SalvarBack;
- import com.redewally.manager.events.ShopListener;
- import com.redewally.manager.kits.MainInventory;
- import com.redewally.manager.kits.categories.BasicInventory;
- import com.redewally.manager.kits.categories.RanksInventory;
- import com.redewally.manager.kits.categories.VIPInventory;
- import com.redewally.manager.kits.preview.PreviewBasicoInventory;
- import com.redewally.manager.kits.preview.PreviewDiarioInventory;
- import com.redewally.manager.kits.preview.PreviewMensalInventory;
- import com.redewally.manager.kits.preview.PreviewSemanalInventory;
- import com.redewally.manager.lixeira.CentralL;
- import com.redewally.manager.lixeira.Comando_Lixeira;
- import com.redewally.manager.utils.CashSQL;
- import com.redewally.manager.utils.Lists;
- import com.redewally.manager.utils.RankupCore;
- import com.redewally.manager.utils.Reflection;
- import com.redewally.manager.utils.StartedTime;
- import com.redewally.manager.utils.TimeFormater;
- import java.io.ByteArrayOutputStream;
- import java.io.DataOutputStream;
- import java.io.File;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.NavigableMap;
- import java.util.TreeMap;
- import java.util.concurrent.TimeUnit;
- import net.milkbowl.vault.economy.Economy;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.RegisteredServiceProvider;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.scheduler.BukkitRunnable;
- import org.bukkit.scheduler.BukkitScheduler;
- import ru.tehkode.permissions.PermissionUser;
- import ru.tehkode.permissions.bukkit.PermissionsEx;
- public class Main extends JavaPlugin {
- public Lists lists = new Lists();
- public HashMap<Location, ItemStack> spawners = new HashMap();
- public HashMap<String, Cash> cache = new HashMap();
- public ArrayList<String> preLogin = new ArrayList();
- public ArrayList<String> weiting = new ArrayList();
- public String status;
- public StartedTime start;
- public ProtocolManager protocolManager;
- public Config spawn = new Config(this, "spawn.yml");
- public Config data = new Config(this, "data.yml");
- public static CashSQL sql;
- public static String player = "";
- public static String chat_status;
- public static FileConfiguration cnf;
- public static Main pl;
- public static Main plugin;
- public static ArrayList<String> logado = new ArrayList();
- public static Title titleapi;
- public static Main instance;
- public static List<String> sites = new ArrayList();
- public static Economy econ;
- public static Economy economy;
- private static Prefixos so;
- private static RankupCore core;
- private static Chat c;
- private static String symbol = "•";
- public static int rst;
- public static int time = 0;
- public static long uptime = 0L;
- public static boolean loockclans = false;
- public static boolean Restart;
- public static boolean Reiniciar;
- public static boolean first = false;
- public static boolean muted = false;
- public static final NavigableMap<Long, String> suffixes = new TreeMap();
- private boolean restart = false;
- public FileConfiguration DATA_YAML;
- public File f;
- public FileConfiguration DATA_YAML2;
- public File f2;
- static {
- loockclans = false;
- uptime = 0L;
- Restart = false;
- Reiniciar = false;
- }
- public static Main getInstance() {
- return instance;
- }
- public static Main getPlugin() {
- return plugin;
- }
- public static boolean isWeiting(String p) {
- return !getInstance().weiting.contains(p);
- }
- public void onEnable() {
- plugin = this;
- chat_status = "ON";
- instance = this;
- muted = false;
- sites.add("google.com.br");
- sites.add("google.com");
- sites.add("prnt");
- sites.add("redeseed");
- sites.add("seednetwork");
- sites.add("seedmc");
- sites.add("youtube");
- sites.add("youtu.be");
- Restart = false;
- Reiniciar = false;
- Manager manager = new Manager();
- info("Habilitando...");
- info("Habilitado com sucesso.");
- File f = new File("plugins/SeedManager");
- sql = new CashSQL();
- time = this.getConfig().getInt("cleartime");
- this.start = new StartedTime(System.currentTimeMillis());
- this.protocolManager = ProtocolLibrary.getProtocolManager();
- c = new Chat();
- core = new RankupCore(this);
- so = new Prefixos();
- suffixes.put(1000L, "K");
- suffixes.put(1000000L, "KK");
- suffixes.put(1000000000L, "B");
- suffixes.put(1000000000000L, "T");
- suffixes.put(1000000000000000L, "Q");
- suffixes.put(1000000000000000000L, "E");
- this.createCustomConfig();
- this.createCustomConfig2();
- this.saveConfig();
- this.setupEconomy();
- manager.run();
- MobLimiter.load();
- this.status = "DESMUTADO";
- this.data.saveDefaultConfig();
- this.saveDefaultConfig();
- new Reflection(this);
- this.setupEconomy();
- AntiJigsaw listener = new AntiJigsaw(this, this.getConfig());
- ProtocolLibrary.getProtocolManager().addPacketListener(listener);
- BukkitScheduler var10000 = Bukkit.getScheduler();
- List var10002 = listener.uuids;
- listener.uuids.getClass();
- var10000.scheduleSyncDelayedTask(this, var10002::clear, 5L);
- cnf = this.getConfig();
- if (!(new File(this.getDataFolder(), "locais.yml")).exists()) {
- this.saveDefaultConfig();
- }
- if (!f.exists()) {
- f.mkdirs();
- }
- cnf = this.getConfig();
- if (!(new File(this.getDataFolder(), "config.yml")).exists()) {
- this.saveDefaultConfig();
- }
- if (!this.getServer().getMessenger().isOutgoingChannelRegistered(this, "BungeeCord")) {
- this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
- }
- Bukkit.getServer().getConsoleSender().sendMessage("§a[SeedManager] Plugin habilitado com sucesso!");
- Bukkit.getServer().getPluginManager().registerEvents(new Listeners(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new EsconderListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new IPListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new NoStack(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new DeusListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new PreloginListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new ActionInfo(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new CapirotoListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new Chat(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new CentralL(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new PreviewBasicoInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new PreviewDiarioInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new PreviewMensalInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new PreviewSemanalInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new SalvarBack(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new ShopListener(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new RanksInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new MainInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new BasicInventory(), this);
- Bukkit.getServer().getPluginManager().registerEvents(new VIPInventory(), this);
- this.getCommand("Lagg").setExecutor(new CommandChunk());
- this.getCommand("Gamemode").setExecutor(new CommandGerais());
- this.getCommand("Iteminfo").setExecutor(new CommandItemInfo());
- this.getCommand("S").setExecutor(new CommandStaff());
- this.getCommand("Set").setExecutor(new CommandGerais());
- this.getCommand("Spawn").setExecutor(new CommandSpawn());
- this.getCommand("Fertilizar").setExecutor(new CommandFertilizar());
- this.getCommand("Promover").setExecutor(new CommandPromote());
- this.getCommand("Kit").setExecutor(new CommandKit());
- this.getCommand("G").setExecutor(new CommandGlobal());
- this.getCommand("Cash").setExecutor(new CashCommand());
- this.getCommand("Chat").setExecutor(new CommandChat());
- this.getCommand("Lixeira").setExecutor(new Comando_Lixeira());
- this.getCommand("Compactar").setExecutor(new CommandCompactar());
- this.getCommand("Limparchat").setExecutor(new CommandLimparChat());
- this.getCommand("Chatvip").setExecutor(new CommandChatVIP());
- this.getCommand("Enchant").setExecutor(new CommandEnchant());
- this.getCommand("Fix").setExecutor(new CommandReparar());
- this.getCommand("Setspawn").setExecutor(new CommandSpawn());
- this.getCommand("Arena").setExecutor(new CommandGerais());
- this.getCommand("Mina").setExecutor(new CommandGerais());
- this.getCommand("MinaPvP").setExecutor(new CommandGerais());
- this.getCommand("Loja").setExecutor(new CommandGerais());
- this.getCommand("Reportar").setExecutor(new CommandReportar());
- this.getCommand("ToggleReportar").setExecutor(new CommandReportar());
- this.getCommand("Enderchest").setExecutor(new CommandEnderChest());
- this.getCommand("Vip").setExecutor(new CommandVIP());
- this.getCommand("SetVip").setExecutor(new CommandVIP());
- this.getCommand("Memory").setExecutor(new CommandMemory());
- this.getCommand("Back").setExecutor(new CommandBack());
- this.getCommand("Ping").setExecutor(new CommandPing());
- this.getCommand("B").setExecutor(new CommandBunker());
- this.getCommand("List").setExecutor(new CommandGerais());
- this.getCommand("Tell").setExecutor(new CommandTell());
- this.getCommand("Tpa").setExecutor(new CommandTpa());
- this.getCommand("Tpaaceitar").setExecutor(new CommandTpa());
- this.getCommand("Tpanegar").setExecutor(new CommandTpa());
- this.getCommand("Head").setExecutor(new CommandHead());
- this.getCommand("Luz").setExecutor(new CommandLuz());
- this.getCommand("Invsee").setExecutor(new CommandOlharInventario());
- this.getCommand("Saircomestilo").setExecutor(new CommandSairComEstilo());
- this.getCommand("Tp").setExecutor(new CommandTeleportar());
- this.getCommand("Speed").setExecutor(new CommandSpeed());
- this.getCommand("Api").setExecutor(new CommandAPI());
- this.getCommand("Craft").setExecutor(new CommandCraft());
- this.getCommand("Dia").setExecutor(new CommandDia());
- this.getCommand("Uptime").setExecutor(new CommandUptime());
- this.getCommand("Noite").setExecutor(new CommandNoite());
- this.getCommand("Tpall").setExecutor(new CommandTpall());
- this.getCommand("Give").setExecutor(new CommandGive());
- this.getCommand("Kill").setExecutor(new CommandKill());
- this.getCommand("Mobstack").setExecutor(new CommandMobstack());
- this.getCommand("Gamemode").setExecutor(new CommandGerais());
- this.getCommand("Hat").setExecutor(new CommandChapeu());
- this.getCommand("God").setExecutor(new CommandDeus());
- this.getCommand("Esconder").setExecutor(new CommandEsconder());
- this.getCommand("Rocket").setExecutor(new CommandRocket());
- this.getCommand("Kick").setExecutor(new CommandKick());
- this.getCommand("Title").setExecutor(new CommandTitle());
- this.getCommand("Top").setExecutor(new CommandTop());
- this.getCommand("Gm").setExecutor(new CommandGerais());
- this.getCommand("Fly").setExecutor(new CommandGerais());
- this.getCommand("Fakes").setExecutor(new CommandGerais());
- this.getCommand("Clear").setExecutor(new CommandLimpar());
- this.getCommand("Cc").setExecutor(new CommandGerais());
- this.getCommand("List").setExecutor(new CommandGerais());
- this.getCommand("Online").setExecutor(new CommandGerais());
- this.getCommand("V").setExecutor(new CommandGerais());
- this.getCommand("Reiniciar").setExecutor(new CommandReiniciar());
- this.getCommand("Heal").setExecutor(new CommandHeal());
- this.getCommand("Anuncio").setExecutor(new CommandAnuncio());
- Iterator var6 = getInstance().data.getConfig().getConfigurationSection("Data").getKeys(false).iterator();
- while(var6.hasNext()) {
- String add = (String)var6.next();
- double coins = getInstance().data.getConfig().getDouble("Data." + add + ".Coins");
- Cash gc = new Cash(add, coins);
- this.cache.put(add, gc);
- }
- Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
- public void run() {
- }
- }, 1500L, 1500L);
- Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
- public void run() {
- }
- }, 5400L, 5400L);
- Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
- public void run() {
- Iterator var2 = Bukkit.getOnlinePlayers().iterator();
- while(var2.hasNext()) {
- Player p = (Player)var2.next();
- Tablist.sendTitleTab(p, "§f \n§6§lSEED MC §7\n§fwww.seed-mc.online §d\n\n §aPromoção de Inauguração!§9\n §aPacotes §l25% §aOFF, utilize o cupom §lFULLPVP§a!\n§f", "§f \n§6Twitter:§f twitter.com/ServidoresSeed \n§6Discord:§f discord.seed-mc.online \n§6Fórum:§f forum.seed-mc.online\n§f \n§f \n §6 Adquira VIP e CASH acessando: §floja.seed-mc.online \n§f");
- }
- }
- }, 50L, 50L);
- }
- public void atualizar() {
- (new BukkitRunnable() {
- public void run() {
- if (!Main.this.restart) {
- String time = TimeFormater.format(System.currentTimeMillis() - Main.getInstance().start.getStartedTime());
- if (time.toLowerCase().contains("6h")) {
- Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "reiniciar auto");
- Main.this.restart = true;
- }
- }
- }
- }).runTaskTimerAsynchronously(this, 20L, 20L);
- }
- public static void info(String msg) {
- Bukkit.getConsoleSender().sendMessage("§e[SeedManager] " + msg);
- }
- public static void serverConnect(Player p, String server) {
- ByteArrayOutputStream b = new ByteArrayOutputStream();
- DataOutputStream out = new DataOutputStream(b);
- try {
- out.writeUTF("Connect");
- out.writeUTF(server);
- } catch (IOException var5) {
- var5.printStackTrace();
- }
- p.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
- }
- void createCustomConfig() {
- this.f = new File(this.getDataFolder(), "kits.yml");
- if (!this.f.exists()) {
- try {
- this.f.createNewFile();
- } catch (IOException var2) {
- Bukkit.getConsoleSender().sendMessage("§cNão foi possível criar o arquivo kits.yml");
- }
- }
- this.DATA_YAML = YamlConfiguration.loadConfiguration(this.f);
- }
- void createCustomConfig2() {
- this.f2 = new File(this.getDataFolder(), "spawners.yml");
- if (!this.f2.exists()) {
- try {
- this.f2.createNewFile();
- } catch (IOException var2) {
- Bukkit.getConsoleSender().sendMessage("§cNão foi possível criar o arquivo spawners.yml");
- }
- }
- this.DATA_YAML2 = YamlConfiguration.loadConfiguration(this.f2);
- }
- public void onDisable() {
- Bukkit.getServer().getConsoleSender().sendMessage("§c[SeedManager] Plugin desabilitado com sucesso!");
- this.saveDefaultConfig();
- Iterator var2 = Cash.getAll().iterator();
- while(var2.hasNext()) {
- Cash c = (Cash)var2.next();
- c.save();
- }
- }
- public static Chat getChat() {
- return c;
- }
- public static Prefixos getPrefixosAPI() {
- return so;
- }
- public static RankupCore getCore() {
- return core;
- }
- public static String getSymbol() {
- return symbol;
- }
- public static double getMoneyJogador(String p) {
- getInstance();
- return economy.getBalance(p);
- }
- public static double getMoney(Player p) {
- return getMoneyJogador(p.getName()) >= 1.0E10D ? 1.0E9D : getMoneyJogador(p.getName());
- }
- public static void debug(String msg) {
- Bukkit.getConsoleSender().sendMessage("§e[SeedManager] " + msg);
- }
- private boolean setupEconomy() {
- if (this.getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- } else {
- RegisteredServiceProvider<Economy> economyProvider = this.getServer().getServicesManager().getRegistration(Economy.class);
- if (economyProvider != null) {
- economy = (Economy)economyProvider.getProvider();
- }
- return economy != null;
- }
- }
- public String formatDifference(long time) {
- if (time == 0L) {
- return "nunca";
- } else {
- long day = TimeUnit.MILLISECONDS.toDays(time);
- long hours = TimeUnit.MILLISECONDS.toHours(time) - day * 24L;
- long minutes = TimeUnit.MILLISECONDS.toMinutes(time) - TimeUnit.MILLISECONDS.toHours(time) * 60L;
- long seconds = TimeUnit.MILLISECONDS.toSeconds(time) - TimeUnit.MILLISECONDS.toMinutes(time) * 60L;
- StringBuilder sb = new StringBuilder();
- if (day > 0L) {
- sb.append(day).append(" ").append(day == 1L ? "dia" : "dias").append(" ");
- }
- if (hours > 0L) {
- sb.append(hours).append(" ").append(hours == 1L ? "hora" : "horas").append(" ");
- }
- if (minutes > 0L) {
- sb.append(minutes).append(" ").append(minutes == 1L ? "minuto" : "minutos").append(" ");
- }
- if (seconds > 0L) {
- sb.append(seconds).append(" ").append(seconds == 1L ? "segundo" : "segundos");
- }
- String diff = sb.toString();
- return diff.isEmpty() ? "agora" : diff;
- }
- }
- public String getRank(String player) {
- PermissionUser pex = PermissionsEx.getUser(player);
- int size = pex.getGroupNames().length;
- if (size >= 2) {
- String primary = pex.getGroupNames()[0];
- String vip = pex.getGroupNames()[1];
- if (primary.equalsIgnoreCase("Membro")) {
- return !vip.equalsIgnoreCase("nenhum") ? vip : "Membro";
- } else {
- return primary;
- }
- } else {
- return pex.getGroupNames()[0];
- }
- }
- static void access$1(Main main, boolean restart) {
- main.restart = restart;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement