getAll() {
20 | return KITS.values();
21 | }
22 |
23 | public static void create(String nome, Kit kit) {
24 | KITS.put(nome, kit);
25 | }
26 |
27 | public static void delete(String nome) {
28 | File file = DataManager.getFile(nome, "kits");
29 | DataManager.deleteFile(file);
30 | KITS.remove(nome);
31 | }
32 |
33 | public static boolean contains(String nome) {
34 | return KITS.containsKey(nome);
35 | }
36 |
37 | public static void loadKits() {
38 | KITS.clear();
39 |
40 | File folder = DataManager.getFolder("kits");
41 | File[] file = folder.listFiles();
42 | if(file != null) {
43 | for (int i = 0; i < file.length; i++) {
44 | if (file[i] != null && file[i].isFile()) {
45 | FileConfiguration configKit = DataManager.getConfiguration(file[i]);
46 | String id = file[i].getName().replace(".yml", "");
47 | String nome = configKit.getString("Nome", "§rKit '" + id + "' sem nome! Use /editarkit!");
48 | String permissao = configKit.getString("Permissao", "");
49 | long delay = configKit.getLong("Delay");
50 | String mensagemDeErro = configKit.getString("MensagemDeErro", "");
51 | String itens = configKit.getString("Itens");
52 | Kit kit = new Kit(id, permissao, nome, delay, mensagemDeErro, itens);
53 | KITS.put(id, kit);
54 | }
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/rush/addons/MassiveFactions.java:
--------------------------------------------------------------------------------
1 | package rush.addons;
2 |
3 | import org.bukkit.Location;
4 | import org.bukkit.entity.Player;
5 |
6 | import com.massivecraft.factions.Factions;
7 | import com.massivecraft.factions.Rel;
8 | import com.massivecraft.factions.entity.BoardColl;
9 | import com.massivecraft.factions.entity.Faction;
10 | import com.massivecraft.factions.entity.MPlayer;
11 | import com.massivecraft.massivecore.ps.PS;
12 |
13 | import rush.configuracoes.Mensagens;
14 |
15 | public class MassiveFactions {
16 |
17 | public static boolean isValidTeleport(Location l, Player p) {
18 | MPlayer mp = MPlayer.get(p);
19 | BoardColl coll = BoardColl.get();
20 | Faction faction = coll.getFactionAt(PS.valueOf(l));
21 | if (!faction.getMPlayers().contains(mp) && !(faction.getRelationTo(mp.getFaction()) == Rel.ALLY)) {
22 | if (faction.getId().equals(Factions.ID_NONE) || faction.getId().equals(Factions.ID_WARZONE) || faction.getId().equals(Factions.ID_SAFEZONE)) {
23 | return true;
24 | } else {
25 | p.sendMessage(Mensagens.Sem_Permissao_Teleportar.replace("%faction%", faction.getName()));
26 | return false;
27 | }
28 | }
29 | return true;
30 | }
31 |
32 | public static boolean isValidSetHome(Location l, Player p) {
33 | MPlayer mp = MPlayer.get(p);
34 | BoardColl coll = BoardColl.get();
35 | Faction faction = coll.getFactionAt(PS.valueOf(l));
36 | if (!faction.getMPlayers().contains(mp) && !(faction.getRelationTo(mp.getFaction()) == Rel.ALLY)) {
37 | if (faction.getId().equals(Factions.ID_NONE) || faction.getId().equals(Factions.ID_WARZONE) || faction.getId().equals(Factions.ID_SAFEZONE)) {
38 | return true;
39 | } else {
40 | p.sendMessage(Mensagens.Sem_Permissao_Sethome.replace("%faction%", faction.getName()));
41 | return false;
42 | }
43 | }
44 | return true;
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/src/rush/utils/manager/DataManager.java:
--------------------------------------------------------------------------------
1 | package rush.utils.manager;
2 |
3 | import java.io.File;
4 |
5 | import org.bukkit.Bukkit;
6 | import org.bukkit.configuration.file.FileConfiguration;
7 | import org.bukkit.configuration.file.YamlConfiguration;
8 |
9 | import rush.Main;
10 | import rush.configuracoes.Mensagens;
11 |
12 | public class DataManager {
13 |
14 | public static void createFolder(String folder) {
15 | try {
16 | File pasta = new File(Main.get().getDataFolder() + File.separator + folder);
17 | if (!pasta.exists()) {
18 | pasta.mkdirs();
19 | }
20 | } catch (Throwable e) {
21 | Bukkit.getConsoleSender().sendMessage(Mensagens.Falha_Ao_Criar_Pasta.replace("%pasta%", folder));
22 | e.printStackTrace();
23 | }
24 | }
25 |
26 | public static void createFile(File file) {
27 | try {
28 | file.createNewFile();
29 | } catch (Throwable e) {
30 | Bukkit.getConsoleSender().sendMessage(Mensagens.Falha_Ao_Criar_Arquivo.replace("%arquivo%", file.getName()));
31 | e.printStackTrace();
32 | }
33 | }
34 |
35 | public static File getFolder(String folder) {
36 | File Arquivo = new File(Main.get().getDataFolder() + File.separator + folder);
37 | return Arquivo;
38 | }
39 |
40 | public static File getFile(String file, String folder) {
41 | File Arquivo = new File(Main.get().getDataFolder() + File.separator + folder, file + ".yml");
42 | return Arquivo;
43 | }
44 |
45 | public static File getFile(String file) {
46 | File Arquivo = new File(Main.get().getDataFolder() + File.separator + file + ".yml");
47 | return Arquivo;
48 | }
49 |
50 | public static FileConfiguration getConfiguration(File file) {
51 | FileConfiguration config = (FileConfiguration) YamlConfiguration.loadConfiguration(file);
52 | return config;
53 | }
54 |
55 | public static void deleteFile(File file) {
56 | file.delete();
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/src/rush/utils/objectStream/BukkitObjectOutputStream.java:
--------------------------------------------------------------------------------
1 | package rush.utils.objectStream;
2 |
3 | import java.io.IOException;
4 | import java.io.ObjectOutputStream;
5 | import java.io.OutputStream;
6 | import java.io.Serializable;
7 |
8 | import org.bukkit.configuration.serialization.ConfigurationSerializable;
9 |
10 | /**
11 | * This class is designed to be used in conjunction with the {@link
12 | * ConfigurationSerializable} API. It translates objects to an internal
13 | * implementation for later deserialization using {@link
14 | * BukkitObjectInputStream}.
15 | *
16 | * Behavior of implementations extending this class is not guaranteed across
17 | * future versions.
18 | */
19 | public class BukkitObjectOutputStream extends ObjectOutputStream {
20 |
21 | /**
22 | * Constructor provided to mirror super functionality.
23 | *
24 | * @throws IOException
25 | * @throws SecurityException
26 | * @see ObjectOutputStream#ObjectOutputStream()
27 | */
28 | protected BukkitObjectOutputStream() throws IOException, SecurityException {
29 | super();
30 | super.enableReplaceObject(true);
31 | }
32 |
33 | /**
34 | * Object output stream decoration constructor.
35 | *
36 | * @param out
37 | * @throws IOException
38 | * @see ObjectOutputStream#ObjectOutputStream(OutputStream)
39 | */
40 | public BukkitObjectOutputStream(OutputStream out) throws IOException {
41 | super(out);
42 | super.enableReplaceObject(true);
43 | }
44 |
45 | @Override
46 | protected Object replaceObject(Object obj) throws IOException {
47 | if (!(obj instanceof Serializable) && (obj instanceof ConfigurationSerializable)) {
48 | obj = Wrapper.newWrapper((ConfigurationSerializable) obj);
49 | }
50 |
51 | return super.replaceObject(obj);
52 | }
53 |
54 | }
--------------------------------------------------------------------------------
/src/rush/apis/SkullAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Field;
4 | import java.util.Base64;
5 | import java.util.Base64.Encoder;
6 | import java.util.UUID;
7 |
8 | import org.bukkit.Material;
9 | import org.bukkit.inventory.ItemStack;
10 | import org.bukkit.inventory.meta.SkullMeta;
11 |
12 | import com.mojang.authlib.GameProfile;
13 | import com.mojang.authlib.properties.Property;
14 |
15 | import rush.utils.ReflectionUtils;
16 |
17 | public class SkullAPI {
18 |
19 | private static Encoder encoder;
20 | private static ItemStack base;
21 | private static Field profileField;
22 |
23 | public static ItemStack getByUrl(String url) {
24 | ItemStack skull = base.clone();
25 | try {
26 | SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
27 | GameProfile profile = new GameProfile(UUID.randomUUID(), null);
28 | byte[] encodedData = encoder.encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes());
29 | profile.getProperties().put("textures", new Property("textures", new String(encodedData)));
30 | profileField.set(skullMeta, profile);
31 | skull.setItemMeta(skullMeta);
32 | } catch (Throwable e) {
33 | e.printStackTrace();
34 | }
35 | return skull;
36 | }
37 |
38 | public static ItemStack getByName(String name) {
39 | ItemStack skull = base.clone();
40 | SkullMeta meta = (SkullMeta) skull.getItemMeta();
41 | meta.setOwner(name);
42 | skull.setItemMeta(meta);
43 | return skull;
44 | }
45 |
46 | static void load() {
47 | try
48 | {
49 | base = new ItemStack(Material.SKULL_ITEM);
50 | base.setDurability((short) 3);
51 | Class> skullMetaClass = ReflectionUtils.getOBClass("inventory.CraftMetaSkull");
52 | profileField = skullMetaClass.getDeclaredField("profile");
53 | profileField.setAccessible(true);
54 | encoder = Base64.getEncoder();
55 | }
56 | catch (Throwable e) {}
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/rush/apis/GodModeAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 |
6 | import org.bukkit.entity.Player;
7 |
8 | import rush.Main;
9 | import rush.utils.ReflectionUtils;
10 |
11 | public class GodModeAPI {
12 |
13 | private static Method getHandle;
14 | private static Field abilitiesField;
15 | private static Field isInvulnerableField;
16 |
17 | public static void setGodMode(Player player, boolean enabled) {
18 | try {
19 |
20 | if (Main.getVersion().value < 17) {
21 | Object entityPlayer = getHandle.invoke(player);
22 | Object abilities = abilitiesField.get(entityPlayer);
23 | isInvulnerableField.set(abilities, enabled);
24 | } else {
25 | player.getClass().getMethod("setInvulnerable", boolean.class).invoke(player, enabled);
26 | }
27 |
28 | } catch (Throwable e) {
29 | e.printStackTrace();
30 | }
31 | }
32 |
33 | public static boolean getGodMode(Player player) {
34 | try {
35 |
36 | if (Main.getVersion().value < 17) {
37 | Object entityPlayer = getHandle.invoke(player);
38 | Object abilities = abilitiesField.get(entityPlayer);
39 | return isInvulnerableField.getBoolean(abilities);
40 | } else {
41 | return (boolean) player.getClass().getMethod("isInvulnerable").invoke(player);
42 | }
43 |
44 | } catch (Throwable e) {
45 | e.printStackTrace();
46 | return false;
47 | }
48 | }
49 |
50 | static void load() {
51 | try
52 | {
53 | if (Main.getVersion().value < 17) {
54 | Class> craftPlayerClass = ReflectionUtils.getOBClass("entity.CraftPlayer");
55 | Class> entityPlayerClass = ReflectionUtils.getNMSClass("EntityPlayer");
56 | Class> playerAbilitiesClass = ReflectionUtils.getNMSClass("PlayerAbilities");
57 | getHandle = craftPlayerClass.getMethod("getHandle");
58 | abilitiesField = entityPlayerClass.getField("abilities");
59 | isInvulnerableField =playerAbilitiesClass.getField("isInvulnerable");
60 | }
61 | }
62 | catch (Throwable e) {}
63 | }
64 |
65 | }
--------------------------------------------------------------------------------
/src/rush/recursos/gerais/LimiteDePlayers.java:
--------------------------------------------------------------------------------
1 | package rush.recursos.gerais;
2 |
3 | import java.util.Random;
4 |
5 | import org.bukkit.Bukkit;
6 | import org.bukkit.entity.Player;
7 | import org.bukkit.event.EventHandler;
8 | import org.bukkit.event.EventPriority;
9 | import org.bukkit.event.Listener;
10 | import org.bukkit.event.player.PlayerLoginEvent;
11 | import org.bukkit.event.player.PlayerLoginEvent.Result;
12 | import org.bukkit.event.server.ServerListPingEvent;
13 | import org.bukkit.scheduler.BukkitRunnable;
14 |
15 | import rush.Main;
16 | import rush.configuracoes.Mensagens;
17 | import rush.configuracoes.Settings;
18 |
19 | public class LimiteDePlayers implements Listener {
20 |
21 | @EventHandler
22 | public void aoVerMotd(ServerListPingEvent e) {
23 | e.setMaxPlayers(Settings.Limite_De_Players);
24 | }
25 |
26 | @EventHandler(priority = EventPriority.LOWEST)
27 | public void aoEntrar(PlayerLoginEvent e) {
28 | int playersOnline = Bukkit.getOnlinePlayers().size();
29 | int limite = Settings.Limite_De_Players;
30 | if (playersOnline >= limite) {
31 | if (!e.getPlayer().hasPermission("system.lotado.entrar")) {
32 | e.setResult(Result.KICK_FULL);
33 | e.setKickMessage(Mensagens.Servidor_Lotado);
34 | } else if (Settings.Kickar_Sem_Vip) {
35 | Player[] players = Bukkit.getOnlinePlayers().toArray(new Player[playersOnline]);
36 | int cont = 0;
37 | while(cont < 4) {
38 | int random = new Random().nextInt(playersOnline);
39 | Player p = players[random];
40 | if (p.hasPermission("system.lotado.entrar")) {
41 | cont++;
42 | continue;
43 | } else {
44 | kickPlayer(p);
45 | return;
46 | }
47 | }
48 | }
49 | }
50 | }
51 |
52 | private void kickPlayer(Player p) {
53 | p.sendMessage(Mensagens.Aviso_Dar_Lugar_Ao_Vip);
54 | new BukkitRunnable() {
55 | @Override
56 | public void run() {
57 | if (p != null)
58 | p.kickPlayer(Mensagens.Kick_Dar_Lugar_Ao_Vip);
59 | }
60 | }.runTaskLater(Main.get(), 20L * Settings.Tempo_Para_Ser_Kick);
61 | }
62 |
63 | }
--------------------------------------------------------------------------------
/src/rush/apis/TablistAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 |
6 | import org.bukkit.entity.Player;
7 |
8 | import rush.Main;
9 | import rush.utils.ReflectionUtils;
10 |
11 | public class TablistAPI {
12 |
13 | private static Class> ppop;
14 | private static Method a;
15 | private static Field headerField;
16 | private static Field footerField;
17 |
18 | public static void sendTabList(Player player, String header, String footer) {
19 | try {
20 |
21 | if (Main.getVersion().value < 17) {
22 | Object tabHeader = a.invoke(null, "{\"text\":\"" + header + "\"}");
23 | Object tabFooter = a.invoke(null, "{\"text\":\"" + footer + "\"}");
24 | Object packet = ppop.newInstance();
25 |
26 | headerField.set(packet, tabHeader);
27 | footerField.set(packet, tabFooter);
28 |
29 | ReflectionUtils.sendPacket(player, packet);
30 | } else {
31 | player.getClass().getMethod("setPlayerListHeaderFooter", String.class, String.class).invoke(player, header, footer);
32 | }
33 |
34 | } catch (Throwable e) {
35 | e.printStackTrace();
36 | }
37 | }
38 |
39 | static void load() {
40 | try
41 | {
42 | if (Main.getVersion().value < 17) {
43 | Class> icbc = ReflectionUtils.getNMSClass("IChatBaseComponent");
44 | ppop = ReflectionUtils.getNMSClass("PacketPlayOutPlayerListHeaderFooter");
45 |
46 | if (icbc.getDeclaredClasses().length > 0) {
47 | a = icbc.getDeclaredClasses()[0].getMethod("a", String.class);
48 | } else {
49 | a = ReflectionUtils.getNMSClass("ChatSerializer").getMethod("a", String.class);
50 | }
51 |
52 | int h, f;
53 | if (ppop.getDeclaredFields().length > 2) {
54 | h = 2;
55 | f = 3;
56 | } else {
57 | h = 0;
58 | f = 1;
59 | }
60 |
61 | headerField = ppop.getDeclaredFields()[h];
62 | footerField = ppop.getDeclaredFields()[f];
63 | headerField.setAccessible(true);
64 | footerField.setAccessible(true);
65 | }
66 | }
67 | catch (Throwable e) {}
68 | }
69 | }
--------------------------------------------------------------------------------
/src/rush/sistemas/spawners/SistemaDeSpawners.java:
--------------------------------------------------------------------------------
1 | package rush.sistemas.spawners;
2 |
3 | import org.bukkit.Material;
4 | import org.bukkit.block.Block;
5 | import org.bukkit.block.CreatureSpawner;
6 | import org.bukkit.enchantments.Enchantment;
7 | import org.bukkit.entity.EntityType;
8 | import org.bukkit.entity.Player;
9 | import org.bukkit.event.EventHandler;
10 | import org.bukkit.event.EventPriority;
11 | import org.bukkit.event.Listener;
12 | import org.bukkit.event.block.BlockBreakEvent;
13 | import org.bukkit.event.block.BlockPlaceEvent;
14 | import org.bukkit.inventory.ItemStack;
15 |
16 | import rush.apis.ItemAPI;
17 | import rush.configuracoes.Mensagens;
18 |
19 | public class SistemaDeSpawners implements Listener {
20 |
21 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
22 | public void aoQuebrarSpawner(BlockBreakEvent e) {
23 | Player p = e.getPlayer();
24 | Block b = e.getBlock();
25 | if (b.getType() == Material.MOB_SPAWNER) {
26 | if (p.getItemInHand().getType().name().contains("PICKAXE")) {
27 | if (p.getItemInHand().getItemMeta().hasEnchant(Enchantment.SILK_TOUCH)) {
28 | CreatureSpawner mobSpawner = (CreatureSpawner) b.getState();
29 | String type = mobSpawner.getSpawnedType().name();
30 | ItemStack spawner = MobSpawner.get(type, 1);
31 | for (ItemStack is : p.getInventory().addItem(spawner).values()) {
32 | b.getWorld().dropItem(b.getLocation(), is);
33 | p.sendMessage(Mensagens.Inventario_Cheio_Quebrou);
34 | }
35 | e.setExpToDrop(0);
36 | }
37 | }
38 | }
39 | }
40 |
41 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
42 | public void aoColocarSpawner(BlockPlaceEvent e) {
43 | Block b = e.getBlock();
44 | if (b.getType() == Material.MOB_SPAWNER) {
45 | try {
46 | CreatureSpawner mobSpawner = (CreatureSpawner) b.getState();
47 | String type = ItemAPI.getInfo(e.getItemInHand(), "Entity");
48 | mobSpawner.setSpawnedType(EntityType.valueOf(type));
49 | mobSpawner.update(true);
50 | } catch (Throwable ex) {
51 | e.getPlayer().sendMessage(Mensagens.Spawner_Bugado);
52 | }
53 | }
54 | }
55 |
56 | }
--------------------------------------------------------------------------------
/src/rush/sistemas/spawners/SistemaDeSpawnersOLD.java:
--------------------------------------------------------------------------------
1 | package rush.sistemas.spawners;
2 |
3 | import org.bukkit.Material;
4 | import org.bukkit.block.Block;
5 | import org.bukkit.block.CreatureSpawner;
6 | import org.bukkit.enchantments.Enchantment;
7 | import org.bukkit.entity.EntityType;
8 | import org.bukkit.entity.Player;
9 | import org.bukkit.event.EventHandler;
10 | import org.bukkit.event.EventPriority;
11 | import org.bukkit.event.Listener;
12 | import org.bukkit.event.block.BlockBreakEvent;
13 | import org.bukkit.event.block.BlockPlaceEvent;
14 | import org.bukkit.inventory.ItemStack;
15 |
16 | import rush.configuracoes.Mensagens;
17 |
18 | public class SistemaDeSpawnersOLD implements Listener {
19 |
20 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
21 | public void aoQuebrarSpawner(BlockBreakEvent e) {
22 | Player p = e.getPlayer();
23 | Block b = e.getBlock();
24 | if (b.getType() == Material.MOB_SPAWNER) {
25 | if (p.getItemInHand().getType().name().contains("PICKAXE")) {
26 | if (p.getItemInHand().getItemMeta().hasEnchant(Enchantment.SILK_TOUCH)) {
27 | CreatureSpawner mobSpawner = (CreatureSpawner) b.getState();
28 | String type = mobSpawner.getSpawnedType().name();
29 | ItemStack spawner = MobSpawner.getOld(type, 1);
30 | for (ItemStack is : p.getInventory().addItem(spawner).values()) {
31 | b.getWorld().dropItem(b.getLocation(), is);
32 | p.sendMessage(Mensagens.Inventario_Cheio_Quebrou);
33 | }
34 | e.setExpToDrop(0);
35 | }
36 | }
37 | }
38 | }
39 |
40 | @SuppressWarnings("deprecation")
41 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
42 | public void aoColocarSpawner(BlockPlaceEvent e) {
43 | Block b = e.getBlock();
44 | if (b.getType() == Material.MOB_SPAWNER) {
45 | try {
46 | CreatureSpawner mobSpawner = (CreatureSpawner) b.getState();
47 | short type = e.getItemInHand().getDurability();
48 | mobSpawner.setSpawnedType(EntityType.fromId(type));
49 | mobSpawner.update(true);
50 | } catch (Throwable ex) {
51 | e.getPlayer().sendMessage(Mensagens.Spawner_Bugado);
52 | }
53 | }
54 | }
55 |
56 | }
--------------------------------------------------------------------------------
/src/rush/apis/ActionBarAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Constructor;
4 | import java.lang.reflect.Method;
5 |
6 | import org.bukkit.Bukkit;
7 | import org.bukkit.entity.Player;
8 |
9 | import rush.Main;
10 | import rush.enums.Version;
11 | import rush.utils.ReflectionUtils;
12 |
13 | public class ActionBarAPI {
14 |
15 | private static Method a;
16 | private static Object typeMessage;
17 | private static Constructor> chatConstructor;
18 |
19 | public static void sendActionBar(Player player, String message) {
20 | try {
21 | Object chatMessage = a.invoke(null, "{\"text\":\"" + message + "\"}");
22 | Object packet = chatConstructor.newInstance(chatMessage, typeMessage);
23 | ReflectionUtils.sendPacket(player, packet);
24 | } catch (Throwable e) {
25 | e.printStackTrace();
26 | }
27 | }
28 |
29 | public static void broadcastActionBar(String message) {
30 | try
31 | {
32 | Object chatMessage = a.invoke(null, "{\"text\":\"" + message + "\"}");
33 | Object packet = chatConstructor.newInstance(chatMessage, typeMessage);
34 | for (Player player : Bukkit.getOnlinePlayers()) {
35 | ReflectionUtils.sendPacket(player, packet);
36 | }
37 | } catch (Throwable e) {
38 | e.printStackTrace();
39 | }
40 | }
41 |
42 | static void load() {
43 | try
44 | {
45 | Class> typeMessageClass;
46 | Class> icbc = ReflectionUtils.getNMSClass("IChatBaseComponent");
47 | Class> ppoc = ReflectionUtils.getNMSClass("PacketPlayOutChat");
48 |
49 | if (icbc.getDeclaredClasses().length > 0) {
50 | a = icbc.getDeclaredClasses()[0].getMethod("a", String.class);
51 | } else {
52 | a = ReflectionUtils.getNMSClass("ChatSerializer").getMethod("a", String.class);
53 | }
54 |
55 | if (Main.getVersion() == Version.v1_12 || Main.isVeryNewVersion()) {
56 | typeMessageClass = ReflectionUtils.getNMSClass("ChatMessageType");
57 | typeMessage = typeMessageClass.getEnumConstants()[2];
58 | } else {
59 | typeMessageClass = byte.class;
60 | typeMessage = (byte) 2;
61 | }
62 |
63 | chatConstructor = ppoc.getConstructor(icbc, typeMessageClass);
64 | }
65 | catch (Throwable e) {}
66 | }
67 | }
--------------------------------------------------------------------------------
/src/rush/enums/Version.java:
--------------------------------------------------------------------------------
1 | package rush.enums;
2 |
3 | import org.bukkit.Bukkit;
4 |
5 | import rush.utils.SystemInfo;
6 |
7 | public enum Version {
8 |
9 | v1_21(21),
10 | v1_20(20),
11 | v1_19(19),
12 | v1_18(18),
13 | v1_17 (17),
14 | v1_16_5 (16),
15 | v1_16_4 (16),
16 | v1_16_3 (16),
17 | v1_16_2 (16),
18 | v1_16 (16),
19 | v1_15 (15),
20 | v1_14 (14),
21 | v1_13 (13),
22 | v1_12 (12),
23 | v1_11 (11),
24 | v1_10 (10),
25 | v1_9 (9),
26 | v1_8 (8),
27 | v1_7 (7),
28 | v1_6 (6),
29 | v1_5 (5),
30 | DESCONHECIDA (999);
31 |
32 | public static Version getServerVersion() {
33 | Version version = getServerVersion(SystemInfo.getMinecraftVersion());
34 | if (version == DESCONHECIDA) {
35 | version = getServerVersion(Bukkit.getVersion());
36 | }
37 | return version;
38 | }
39 |
40 | private static Version getServerVersion(String ver) {
41 | if (ver.contains("1.21"))
42 | return v1_21;
43 | if (ver.contains("1.20"))
44 | return v1_20;
45 | if (ver.contains("1.19"))
46 | return v1_19;
47 | if (ver.contains("1.18"))
48 | return v1_18;
49 | if (ver.contains("1.17"))
50 | return v1_17;
51 | else if (ver.contains("1.16.5"))
52 | return v1_16_5;
53 | else if (ver.contains("1.16.4"))
54 | return v1_16_4;
55 | else if (ver.contains("1.16.3"))
56 | return v1_16_3;
57 | else if (ver.contains("1.16.2"))
58 | return v1_16_2;
59 | else if (ver.contains("1.16"))
60 | return v1_16;
61 | else if (ver.contains("1.15"))
62 | return v1_15;
63 | else if (ver.contains("1.14"))
64 | return v1_14;
65 | else if (ver.contains("1.13"))
66 | return v1_13;
67 | else if (ver.contains("1.12"))
68 | return v1_12;
69 | else if (ver.contains("1.11"))
70 | return v1_11;
71 | else if (ver.contains("1.10"))
72 | return v1_10;
73 | else if (ver.contains("1.9"))
74 | return v1_9;
75 | else if (ver.contains("1.8"))
76 | return v1_8;
77 | else if (ver.contains("1.7"))
78 | return v1_7;
79 | else if (ver.contains("1.6"))
80 | return v1_6;
81 | else if (ver.contains("1.5"))
82 | return v1_5;
83 | else
84 | return DESCONHECIDA;
85 | }
86 |
87 | public int value;
88 |
89 | Version(int value) {
90 | this.value = value;
91 | }
92 |
93 | }
--------------------------------------------------------------------------------
/src/rush/utils/objectStream/BukkitObjectInputStream.java:
--------------------------------------------------------------------------------
1 | package rush.utils.objectStream;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.io.ObjectInputStream;
6 |
7 | import org.bukkit.configuration.serialization.ConfigurationSerializable;
8 | import org.bukkit.configuration.serialization.ConfigurationSerialization;
9 |
10 | /**
11 | * This class is designed to be used in conjunction with the {@link
12 | * ConfigurationSerializable} API. It translates objects back to their
13 | * original implementation after being serialized by {@link
14 | * BukkitObjectInputStream}.
15 | *
16 | * Behavior of implementations extending this class is not guaranteed across
17 | * future versions.
18 | */
19 | public class BukkitObjectInputStream extends ObjectInputStream {
20 |
21 | /**
22 | * Constructor provided to mirror super functionality.
23 | *
24 | * @throws IOException
25 | * @throws SecurityException
26 | * @see ObjectInputStream#ObjectInputStream()
27 | */
28 | protected BukkitObjectInputStream() throws IOException, SecurityException {
29 | super();
30 | super.enableResolveObject(true);
31 | }
32 |
33 | /**
34 | * Object input stream decoration constructor.
35 | *
36 | * @param in
37 | * @throws IOException
38 | * @see ObjectInputStream#ObjectInputStream(InputStream)
39 | */
40 | public BukkitObjectInputStream(InputStream in) throws IOException {
41 | super(in);
42 | super.enableResolveObject(true);
43 | }
44 |
45 | @Override
46 | protected Object resolveObject(Object obj) throws IOException {
47 | if (obj instanceof Wrapper) {
48 | try {
49 | (obj = ConfigurationSerialization.deserializeObject(((Wrapper>) obj).map)).getClass(); // NPE
50 | } catch (Throwable ex) {
51 | throw newIOException("Failed to deserialize object", ex);
52 | }
53 | }
54 |
55 | return super.resolveObject(obj);
56 | }
57 |
58 | private static IOException newIOException(String string, Throwable cause) {
59 | IOException exception = new IOException(string);
60 | exception.initCause(cause);
61 | return exception;
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/src/rush/utils/Backup.java:
--------------------------------------------------------------------------------
1 | package rush.utils;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.FileOutputStream;
6 | import java.text.DateFormat;
7 | import java.util.Calendar;
8 | import java.util.Date;
9 | import java.util.zip.ZipEntry;
10 | import java.util.zip.ZipOutputStream;
11 |
12 | import rush.Main;
13 | import rush.utils.manager.DataManager;
14 |
15 | public class Backup {
16 |
17 | public static void create() {
18 | try {
19 | DataManager.createFolder("backups");
20 | Date d = Calendar.getInstance().getTime();
21 | String data = DateFormat.getDateTimeInstance(2, 3).format(d).replace('/', '-').replace(':', ';');
22 | String nome = "Dia " + data.split(" ")[0] + " Hora " + data.split(" ")[1];
23 | String srcFolder = Main.get().getDataFolder().getAbsolutePath();
24 | String destZipFile = DataManager.getFile(nome, "backups").getAbsolutePath().replace(".yml", ".zip");
25 | zipFolder(srcFolder, destZipFile);
26 | } catch (Throwable e) {
27 | e.printStackTrace();
28 | }
29 | }
30 |
31 | private static void zipFolder(String srcFolder, String destZipFile) throws Exception {
32 | FileOutputStream fileWriter = new FileOutputStream(destZipFile);
33 | ZipOutputStream zip = new ZipOutputStream(fileWriter);
34 | addFolderToZip("", srcFolder, zip);
35 | zip.flush();
36 | zip.close();
37 | }
38 |
39 | private static void addFileToZip(String path, String srcFile, ZipOutputStream zip) throws Exception {
40 | File folder = new File(srcFile);
41 | if (folder.isDirectory()) {
42 | addFolderToZip(path, srcFile, zip);
43 | } else {
44 | byte[] buf = new byte[1024];
45 | int len;
46 | FileInputStream in = new FileInputStream(srcFile);
47 | zip.putNextEntry(new ZipEntry(path + "/" + folder.getName()));
48 | while ((len = in.read(buf)) > 0) {
49 | zip.write(buf, 0, len);
50 | }
51 | in.close();
52 | }
53 | }
54 |
55 | private static void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws Exception {
56 | File folder = new File(srcFolder);
57 | if (folder.getName().equals("backups")) return;
58 | for (String fileName : folder.list()) {
59 | if (path.equals("")) {
60 | addFileToZip(folder.getName(), srcFolder + "/" + fileName, zip);
61 | } else {
62 | addFileToZip(path + "/" + folder.getName(), srcFolder + "/" + fileName, zip);
63 | }
64 | }
65 | }
66 |
67 | }
--------------------------------------------------------------------------------
/src/rush/apis/ViewDistanceAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 |
6 | import org.bukkit.entity.Player;
7 |
8 | import rush.Main;
9 | import rush.enums.Version;
10 | import rush.utils.ReflectionUtils;
11 |
12 | public class ViewDistanceAPI {
13 |
14 | private static Class> worldServerClass;
15 | private static Method getPlayerChunkMap;
16 | private static Method updateViewDistance;
17 | private static Method getHandle;
18 | private static Field worldField;
19 | private static Field distanceField;
20 |
21 | public static int getViewDistance(Player player) {
22 | try {
23 | Object entityPlayer = getHandle.invoke(player);
24 | Object world = worldField.get(entityPlayer);
25 | Object worldServer = worldServerClass.cast(world);
26 | Object playerChunkMap = getPlayerChunkMap.invoke(worldServer);
27 | return (int) distanceField.get(playerChunkMap);
28 | } catch (Throwable e) {
29 | return -1;
30 | }
31 | }
32 |
33 | public static void setViewDistance(Player player, int viewDistance) {
34 | try {
35 | Object entityPlayer = getHandle.invoke(player);
36 | Object world = worldField.get(entityPlayer);
37 | Object worldServer = worldServerClass.cast(world);
38 | Object playerChunkMap = getPlayerChunkMap.invoke(worldServer);
39 | updateViewDistance.invoke(playerChunkMap, viewDistance);
40 | } catch (Throwable e) {
41 | e.printStackTrace();
42 | }
43 | }
44 |
45 | static void load() {
46 | try
47 | {
48 | Class> craftPlayerClass = ReflectionUtils.getOBClass("entity.CraftPlayer");
49 | Class> playerChunkMapClass = ReflectionUtils.getNMSClass("PlayerChunkMap");
50 | Class> entityPlayerClass = ReflectionUtils.getNMSClass("EntityPlayer");
51 |
52 | worldField = entityPlayerClass.getField("world");
53 | getHandle = craftPlayerClass.getMethod("getHandle");
54 | worldServerClass = ReflectionUtils.getNMSClass("WorldServer");
55 | getPlayerChunkMap = worldServerClass.getMethod("getPlayerChunkMap");
56 | updateViewDistance = playerChunkMapClass.getMethod("a", int.class);
57 |
58 | String fieldName;
59 | if (Main.getVersion() == Version.v1_8) {
60 | fieldName = "g";
61 | } else {
62 | fieldName = "j";
63 | }
64 |
65 | distanceField = playerChunkMapClass.getDeclaredField(fieldName);
66 | distanceField.setAccessible(true);
67 | }
68 | catch (Throwable e) {}
69 | }
70 | }
--------------------------------------------------------------------------------
/src/rush/entidades/Warps.java:
--------------------------------------------------------------------------------
1 | package rush.entidades;
2 |
3 | import java.io.File;
4 | import java.util.Collection;
5 | import java.util.HashMap;
6 |
7 | import org.bukkit.configuration.file.FileConfiguration;
8 |
9 | import rush.utils.manager.DataManager;
10 |
11 | public abstract class Warps {
12 |
13 | private static HashMap WARPS = new HashMap<>();
14 |
15 | public static Warp get(String warp) {
16 | return WARPS.get(warp);
17 | }
18 |
19 | public static Collection getAll() {
20 | return WARPS.values();
21 | }
22 |
23 | public static void create(String nome, Warp warp) {
24 | WARPS.put(nome, warp);
25 | }
26 |
27 | public static void delete(String nome) {
28 | File file = DataManager.getFile(nome, "warps");
29 | DataManager.deleteFile(file);
30 | WARPS.remove(nome);
31 | }
32 |
33 | public static boolean contains(String nome) {
34 | return WARPS.containsKey(nome);
35 | }
36 |
37 | public static void loadWarps() {
38 | WARPS.clear();
39 | File folder = DataManager.getFolder("warps");
40 | File[] file = folder.listFiles();
41 | if(file != null) {
42 | for (int i = 0; i < file.length; i++) {
43 | if (file[i] != null && file[i].isFile()) {
44 | FileConfiguration configWarp = DataManager.getConfiguration(file[i]);
45 | String nome = file[i].getName().replace(".yml", "");
46 | String loc = configWarp.getString("Localizacao");
47 | String perm = configWarp.getString("Permissao", "");
48 | String semPerm = configWarp.getString("MensagemSemPermissao", "");
49 | int delay = configWarp.getInt("Delay");
50 | boolean delayVip = configWarp.getBoolean("DelayParaVips");
51 | boolean mensagem = configWarp.getBoolean("EnviarMensagem", true);
52 | String inicio = configWarp.getString("MensagemInicio", "");
53 | String fim = configWarp.getString("MensagemFinal", "");
54 | boolean enviar = configWarp.getBoolean("EnviarTitle");
55 | String title = configWarp.getString("Title", "");
56 | String subTitle = configWarp.getString("SubTitle", "");
57 | String teleportado = configWarp.getString("MensagemPlayerTeleportado", "");
58 | String teleportadoStaff = configWarp.getString("MensagemPlayerTeleportadoStaff", "");
59 | Warp warp = new Warp(nome, loc, perm, semPerm, delay, delayVip, mensagem, inicio, fim, enviar, title, subTitle, teleportado, teleportadoStaff);
60 | WARPS.put(nome, warp);
61 | }
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/rush/sistemas/gerais/DeletarComandos.java:
--------------------------------------------------------------------------------
1 | package rush.sistemas.gerais;
2 |
3 | import java.lang.reflect.Field;
4 | import java.util.HashSet;
5 | import java.util.Map;
6 | import java.util.Map.Entry;
7 | import java.util.Set;
8 |
9 | import org.bukkit.Bukkit;
10 | import org.bukkit.command.Command;
11 | import org.bukkit.command.CommandMap;
12 | import org.bukkit.command.SimpleCommandMap;
13 | import org.bukkit.scheduler.BukkitRunnable;
14 |
15 | import rush.Main;
16 | import rush.configuracoes.Settings;
17 |
18 | public class DeletarComandos {
19 |
20 | @SuppressWarnings("unchecked")
21 | public static void deleteCommands() {
22 | new BukkitRunnable() {
23 |
24 | @Override
25 | public void run() {
26 | try
27 | {
28 | Field commandMapField = Bukkit.getPluginManager().getClass().getDeclaredField("commandMap");
29 | Field commandsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
30 | commandMapField.setAccessible(true);
31 | commandsField.setAccessible(true);
32 |
33 | CommandMap commandMap = (CommandMap) commandMapField.get(Bukkit.getPluginManager());
34 | Map commands = (Map) commandsField.get(commandMap);
35 | Set> removes = new HashSet<>();
36 |
37 | for (String line : Settings.Lista_Dos_Comandos_Deletados)
38 | {
39 | String plugin = line.split(":")[0].toLowerCase().trim();
40 | String command = line.split(":")[1].toLowerCase().trim();
41 |
42 | if (command.equals("*")) {
43 | for (Entry entry : commands.entrySet()) {
44 | if (entry.getKey().contains(":") && entry.getKey().toLowerCase().split(":")[0].equals(plugin)) {
45 | removes.add(entry);
46 | }
47 | }
48 | }
49 |
50 | else if (plugin.equals("*")) {
51 | for (Entry entry : commands.entrySet()) {
52 | if (entry.getValue().getName().toLowerCase().equals(command) || (entry.getKey().split(":").length > 1 && entry.getKey().toLowerCase().split(":")[1].equals(command))) {
53 | removes.add(entry);
54 | }
55 | }
56 | }
57 |
58 | else {
59 | for (Entry entry : commands.entrySet()) {
60 | if (entry.getKey().split(":").length > 1 && entry.getKey().toLowerCase().split(":")[0].equals(plugin) && (entry.getValue().getName().toLowerCase().equals(command) || entry.getKey().toLowerCase().split(":")[1].equals(command) )) {
61 | removes.add(entry);
62 | }
63 | }
64 | }
65 | }
66 |
67 | for (Entry entry : removes) {
68 | entry.getValue().unregister(commandMap);
69 | commands.remove(entry.getKey(), entry.getValue());
70 | }
71 |
72 | }
73 | catch (Throwable e) {
74 | e.printStackTrace();
75 | }
76 | }
77 | }.runTaskLaterAsynchronously(Main.get(), 20L * 15L);
78 |
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/src/rush/utils/ReflectionUtils.java:
--------------------------------------------------------------------------------
1 | package rush.utils;
2 |
3 | import java.io.File;
4 | import java.lang.reflect.Field;
5 | import java.lang.reflect.Method;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | import org.bukkit.Bukkit;
10 | import org.bukkit.entity.Player;
11 |
12 | import rush.Main;
13 |
14 | /**
15 | * @author Mior
16 | * @version 1.0
17 | * @category utils
18 | */
19 |
20 | public class ReflectionUtils {
21 |
22 | private static final String version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
23 | private static Method getHandle;
24 | private static Method sendPacket;
25 | private static Field playerConnectionField;
26 |
27 | public static void loadUtils() {
28 | try
29 | {
30 | getHandle = getOBClass("entity.CraftPlayer").getMethod("getHandle");
31 | playerConnectionField = getNMSClass("EntityPlayer").getField("playerConnection");
32 | sendPacket = getNMSClass("PlayerConnection").getMethod("sendPacket", getNMSClass("Packet"));
33 | }
34 | catch (Throwable e) {}
35 | }
36 |
37 | public static Class> getNMSClass(String name) throws ClassNotFoundException {
38 | return Class.forName("net.minecraft.server." + version + "." + name);
39 | }
40 |
41 | public static Class> getOBClass(String name) throws ClassNotFoundException {
42 | return Class.forName("org.bukkit.craftbukkit." + version + "." + name);
43 | }
44 |
45 | public static void sendPacket(Player player, Object packet) {
46 | try {
47 |
48 | if (Main.getVersion().value < 17) {
49 | Object entityPlayer = getHandle.invoke(player);
50 | Object playerConnection = playerConnectionField.get(entityPlayer);
51 | sendPacket.invoke(playerConnection, packet);
52 | } else {
53 | Object handle = player.getClass().getMethod("getHandle").invoke(player);
54 | Object playerConnection = handle.getClass().getField("b").get(handle);
55 | Class> packetClass = Class.forName("net.minecraft.network.protocol.Packet");
56 | playerConnection.getClass().getMethod("sendPacket", packetClass).invoke(playerConnection, packet);
57 | }
58 |
59 | } catch (Throwable e) {
60 | e.printStackTrace();
61 | }
62 | }
63 |
64 | public static List> getProjectClasses(String pckg) {
65 | try {
66 | List> classes = new ArrayList<>();
67 | File directory = new File(Thread.currentThread().getContextClassLoader().getResource(pckg).getFile());
68 | for (File file : directory.listFiles()) {
69 | if (file.getName().endsWith(".class")) {
70 | classes.add(Class.forName(pckg.replace('/', '.') + '.' + file.getName().replace(".class", "")));
71 | } else {
72 | if (file.isDirectory()) {
73 | classes.addAll(getProjectClasses(pckg + "/" + file.getName()));
74 | }
75 | }
76 | }
77 | return classes;
78 | } catch (Throwable e) {
79 | return null;
80 | }
81 | }
82 |
83 | }
--------------------------------------------------------------------------------
/src/rush/utils/serializer/SerializerOLD.java:
--------------------------------------------------------------------------------
1 | package rush.utils.serializer;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.ByteArrayOutputStream;
5 |
6 | import org.bukkit.inventory.ItemStack;
7 | import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
8 |
9 | import rush.utils.objectStream.BukkitObjectInputStream;
10 | import rush.utils.objectStream.BukkitObjectOutputStream;
11 |
12 | public class SerializerOLD {
13 |
14 | public static ItemStack deserializeItemStack(String data) {
15 | try {
16 | ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
17 | BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
18 | dataInput.readInt();
19 | ItemStack item = (ItemStack) dataInput.readObject();
20 |
21 | dataInput.close();
22 | return item;
23 | } catch (Throwable e) {
24 | e.printStackTrace();
25 | }
26 | return null;
27 | }
28 |
29 | public static ItemStack[] deserializeListItemStack(String data) {
30 | try {
31 | ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
32 | BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
33 | ItemStack[] items = new ItemStack[dataInput.readInt()];
34 |
35 | for (int i = 0; i < items.length; i++) {
36 | items[i] = (ItemStack) dataInput.readObject();
37 | }
38 |
39 | dataInput.close();
40 | return items;
41 | } catch (Throwable e) {
42 | e.printStackTrace();
43 | }
44 | return null;
45 | }
46 |
47 | public static String serializeItemStack(ItemStack item) {
48 | try {
49 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
50 | BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
51 |
52 | dataOutput.writeInt(1);
53 |
54 | dataOutput.writeObject(item);
55 |
56 | dataOutput.close();
57 | return Base64Coder.encodeLines(outputStream.toByteArray());
58 | } catch (Throwable e) {
59 | e.printStackTrace();
60 | }
61 | return null;
62 | }
63 |
64 | public static String serializeListItemStack(ItemStack[] items) {
65 | try {
66 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
67 | BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
68 |
69 | dataOutput.writeInt(items.length);
70 |
71 | for (int i = 0; i < items.length; i++) {
72 | dataOutput.writeObject(items[i]);
73 | }
74 |
75 | dataOutput.close();
76 | return Base64Coder.encodeLines(outputStream.toByteArray());
77 | } catch (Throwable e) {
78 | e.printStackTrace();
79 | }
80 | return null;
81 | }
82 |
83 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # System
2 |
3 | Este sistema foi originalmente criado por RUSHyotuber com o intuito de ajudar muitos servidores e facilitar a vida das pessoas. Ao longo do tempo varios contribuintes foram ajudando para a otimização e o aprimoramento projeto.
4 |
5 | Pessoas que contribuiram com o projeto [AnonyDev, LeoDev, Wolf_131, leonardosc, TequilAxBr, zAth, Jota, KickPost, gcunha, Gutyerrez, AlexHackers, BigWriter, Hard, Alomax, Joao Seidel, Pica-Pau, codename_G, Shisui, Kaway, Jamp, dargoh, aureom, VitorBlog, NatanDev, Duck, DvH, MarcioRUSH]
6 |
7 | Link do plugin no Spigot: https://www.spigotmc.org/resources/system.102876/
8 |
9 | Link do plugin na GamersBoard: https://gamersboard.com.br/topic/61255-system-o-seu-novo-super-essentials
10 |
11 | # Atenção Importante
12 | No dia 23 de junho de 2022 foi lançada a versão `1.14.19` do System. A partir deste dia em diante o plugin não receberá mais atualizações.
13 |
14 | Atualmente a ultima versão `1.14.19` do plugin está **100% estável** e **não possui nenhum Bug**!
15 |
16 | A versão dá suporte completo desde o Minecraft **1.5** até o Minecraft **1.19** e também possui um pré-suporte para as versões 1.20 e 1.21 do Minecraft.
17 |
18 | Importante lembrar: o plugin não esta "morto", ele funciona perfeitamente e não possui nenhum problema, ele só não recebe mais atualizações.
19 |
20 | # Agradecimentos
21 | Gostaria de agrader a todas as pessoas que já colaboraram no System, tanto dando sugestões quanto ajudando com códigos ou ajudando a testar o plugin, em fim, gostaria de agradecer a todos que me ajudaram a evoluir como programador e ajudar o plugin a evoluir e se tornar o **plugin brasileiro mais usado**!
22 |
23 | Foram mais de 5 anos trabalhando no System e eu tenho muito orgulho de tudo que foi feito e de tudo que foi criado, muito obrigado a todos!
24 |
25 | ### Você gostaria de dar continuidade no System?
26 | Atualmente o System não possui nenhum desenvolvedor ativo dando continuidade no Projeto, caso você queira dar continuidade no projeto basta aprir um PullRequest ou entrar em contato comigo.
27 |
28 | ### Oque ainda precisaria ser feito no System?
29 | Lista das coisas que ainda precisariam ser feitas no System para melhorar ainda mais o plugin.
30 | - [ ] Adicionar suporte ao sistema de Kits para a versão 1.17 e versões acima da 1.17.
31 | - [ ] Adicionar suporte a cores RGB nas novas versões do minecraft.
32 | - [ ] Adicionar suporte ao comando /bigorna e a funcionalidade bigorna infinita nas versões acima da 1.13.
33 | - [ ] Melhorar o comando /compactar e /derreter para serem compatíveis com os novos minérios das novas versões do minecraft.
34 | - [ ] Melhorar o comando /estatisticas e /verinfo para mostrar informações novas disponíveis nas novas versões do minecraft.
35 | - [ ] Estudar as versões do minecraft desde a 1.13 para identificar novos recursos e funcionalidades interessantes que poderiam ser adicionados no plugin.
36 | - [ ] Analisar as novas necessidades dos servidores modernos do minecraft para entender oque eles estão precisando e adicionar novos recursos e funcionalidades utis no plugin, a ultima vez que esse estudo foi feito foi em 2018.
37 | - [ ] Analisar o Timmings de servidores grandes que usam o System para identificar melhorias que possam ser feitas no código para deixa-lo mais otimizado.
38 |
--------------------------------------------------------------------------------
/src/rush/entidades/Kit.java:
--------------------------------------------------------------------------------
1 | package rush.entidades;
2 |
3 | import org.bukkit.inventory.ItemStack;
4 |
5 | import rush.Main;
6 | import rush.utils.serializer.Serializer;
7 | import rush.utils.serializer.SerializerNEW;
8 | import rush.utils.serializer.SerializerVeryNEW;
9 | import rush.utils.serializer.SerializerOLD;
10 |
11 | public class Kit {
12 |
13 | private String id;
14 | private String nome;
15 | private String permissao;
16 | private long delay;
17 | private String mensagemDeErro;
18 | private ItemStack[] itens;
19 | private int amountItens;
20 |
21 | public Kit(String id, String permissao, String nome, long delay, String mensagemDeErro, String itens) {
22 | ItemStack[] itensStack = getItensByData(itens);
23 | this.id = id;
24 | this.permissao = permissao;
25 | this.nome = nome;
26 | this.delay = delay;
27 | this.mensagemDeErro = mensagemDeErro;
28 | this.itens = itensStack;
29 | this.amountItens = calcule(itensStack);
30 | }
31 |
32 | public String getId() {
33 | return id;
34 | }
35 |
36 | public void setId(String kit) {
37 | this.id = kit;
38 | }
39 |
40 | public String getNome() {
41 | return nome;
42 | }
43 |
44 | public void setNome(String nome) {
45 | this.nome = nome;
46 | }
47 |
48 | public String getPermissao() {
49 | return permissao;
50 | }
51 |
52 | public void setPermissao(String permissao) {
53 | this.permissao = permissao;
54 | }
55 |
56 | public long getDelay() {
57 | return delay;
58 | }
59 |
60 | public void setDelay(long delay) {
61 | this.delay = delay;
62 | }
63 |
64 | public String getMensagemDeErro() {
65 | return mensagemDeErro;
66 | }
67 |
68 | public void setMensagemDeErro(String mensagemDeErro) {
69 | this.mensagemDeErro = mensagemDeErro;
70 | }
71 |
72 | public ItemStack[] getItens() {
73 | return itens;
74 | }
75 |
76 | public void setItens(ItemStack[] itens) {
77 | this.itens = itens;
78 | this.amountItens = calcule(itens);
79 | }
80 |
81 | public int getAmountItens() {
82 | return amountItens;
83 | }
84 |
85 | private int calcule(ItemStack[] itens) {
86 | int amount = 0;
87 | for (ItemStack item : itens) {
88 | if (item != null) amount++;
89 | }
90 | return amount;
91 | }
92 |
93 | private ItemStack[] getItensByData(String data) {
94 | if (Main.isOldVersion())
95 | {
96 | return SerializerOLD.deserializeListItemStack(data);
97 | }
98 | else if (Main.isMotherFuckerVersion())
99 | {
100 | return SerializerVeryNEW.deserializeListItemStack(data);
101 | }
102 | else if (Main.isNewVersion())
103 | {
104 | return SerializerNEW.deserializeListItemStack(data);
105 | }
106 | else
107 | {
108 | return Serializer.deserializeListItemStack(data);
109 | }
110 | }
111 |
112 | @Override
113 | public String toString() {
114 | return nome;
115 | }
116 |
117 | @Override
118 | public int hashCode() {
119 | final int prime = 31;
120 | int result = 1;
121 | result = prime * result + ((id == null) ? 0 : id.hashCode());
122 | return result;
123 | }
124 |
125 | @Override
126 | public boolean equals(Object obj) {
127 | if (this == obj)
128 | return true;
129 | if (obj == null)
130 | return false;
131 | if (getClass() != obj.getClass())
132 | return false;
133 | Kit other = (Kit) obj;
134 | if (id == null) {
135 | if (other.id != null)
136 | return false;
137 | } else if (!id.equals(other.id))
138 | return false;
139 | return true;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/src/rush/sistemas/gerais/StackMobs.java:
--------------------------------------------------------------------------------
1 | package rush.sistemas.gerais;
2 |
3 | import java.util.List;
4 |
5 | import org.bukkit.entity.Entity;
6 | import org.bukkit.entity.EntityType;
7 | import org.bukkit.entity.LivingEntity;
8 | import org.bukkit.event.EventHandler;
9 | import org.bukkit.event.EventPriority;
10 | import org.bukkit.event.Listener;
11 | import org.bukkit.event.entity.CreatureSpawnEvent;
12 | import org.bukkit.event.entity.EntityDeathEvent;
13 | import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
14 | import org.bukkit.inventory.ItemStack;
15 | import org.bukkit.metadata.FixedMetadataValue;
16 |
17 | import rush.Main;
18 | import rush.configuracoes.Settings;
19 | import rush.enums.EntityName;
20 |
21 | public class StackMobs implements Listener {
22 |
23 | private static int MAX_STACK = Settings.Limite_De_Mobs_Agrupados;
24 | private static String NAME = Settings.Nome_Dos_Mobs;
25 | private static boolean KILL_ALL = Settings.Kill_All;
26 | private static double RANGE = Settings.Raio_De_Distancia;
27 | private static List WHITE_LIST = Settings.Lista_De_Mobs_Que_Nao_Agrupam;
28 |
29 | @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
30 | public void onSpawn(CreatureSpawnEvent e) {
31 |
32 | LivingEntity spawned = e.getEntity();
33 | boolean stack = spawned.hasMetadata("stack");
34 | SpawnReason reason = e.getSpawnReason();
35 | EntityType spawnedType = e.getEntityType();
36 |
37 | if ((reason == SpawnReason.EGG) || (reason == SpawnReason.CUSTOM && !stack) || (WHITE_LIST.contains(spawnedType))) return;
38 |
39 |
40 | for (Entity entity : spawned.getNearbyEntities(RANGE, RANGE, RANGE)) {
41 | if (entity.getType() == spawnedType && !entity.isDead()) {
42 | e.setCancelled(true);
43 | int amount = 1;
44 | LivingEntity living = (LivingEntity) entity;
45 |
46 | if (entity.hasMetadata("stack"))
47 | amount += entity.getMetadata("stack").isEmpty() ? 0 : entity.getMetadata("stack").get(0).asInt();
48 |
49 | if (stack)
50 | amount += living.getMetadata("stack").isEmpty() ? 0 : living.getMetadata("stack").get(0).asInt();
51 |
52 | if (amount > MAX_STACK) {
53 | e.setCancelled(true);
54 | return;
55 | }
56 |
57 | String type = EntityName.valueOf(e.getEntityType()).getName();
58 | living.setCustomName(NAME.replace("%tipo%", type).replace("%quantia%", String.valueOf(amount)));
59 | living.setCustomNameVisible(true);
60 | living.setMetadata("stack", new FixedMetadataValue(Main.get(), amount));
61 | return;
62 | }
63 | }
64 |
65 | if (!spawned.hasMetadata("stack")) {
66 | String type = EntityName.valueOf(e.getEntityType()).getName();
67 | spawned.setCustomName(NAME.replace("%tipo%", type).replace("%quantia%", String.valueOf(1)));
68 | spawned.setCustomNameVisible(true);
69 | spawned.setMetadata("stack", new FixedMetadataValue(Main.get(), 1));
70 | }
71 | }
72 |
73 | @EventHandler(priority = EventPriority.MONITOR)
74 | public void onDeath(EntityDeathEvent e) {
75 | LivingEntity entity = e.getEntity();
76 | if (entity.hasMetadata("stack")) {
77 | int cont = entity.getMetadata("stack").isEmpty() ? 0 : entity.getMetadata("stack").get(0).asInt();
78 | if (cont > 1) {
79 | if (KILL_ALL && entity.getKiller() != null && !entity.getKiller().isSneaking()) {
80 | e.setDroppedExp(e.getDroppedExp() * cont);
81 | for (ItemStack drop : e.getDrops()) {
82 | if (drop.getType().getMaxDurability() == 0) {
83 | drop.setAmount(drop.getAmount() * cont);
84 | }
85 | }
86 | } else {
87 | String type = EntityName.valueOf(e.getEntityType()).getName();
88 | LivingEntity spawned = (LivingEntity) entity.getWorld().spawnEntity(entity.getLocation(), e.getEntityType());
89 | spawned.setCustomName(NAME.replace("%tipo%", type).replace("%quantia%", String.valueOf(--cont)));
90 | spawned.setCustomNameVisible(true);
91 | spawned.setMetadata("stack", new FixedMetadataValue(Main.get(), cont));
92 | }
93 | }
94 | }
95 | }
96 |
97 | }
--------------------------------------------------------------------------------
/src/rush/apis/TitleAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Constructor;
4 | import java.lang.reflect.Method;
5 |
6 | import org.bukkit.Bukkit;
7 | import org.bukkit.entity.Player;
8 |
9 | import rush.Main;
10 | import rush.utils.ReflectionUtils;
11 |
12 | public class TitleAPI {
13 |
14 | private static Method a;
15 | private static Object enumTIMES;
16 | private static Object enumTITLE;
17 | private static Object enumSUBTITLE;
18 | private static Constructor> timeTitleConstructor;
19 | private static Constructor> textTitleConstructor;
20 |
21 | public static void sendTitle(Player player, Integer fadeIn, Integer stay, Integer fadeOut, String title, String subtitle) {
22 | try {
23 |
24 | if (Main.getVersion().value < 17) {
25 |
26 | Object chatTitle = a.invoke(null, "{\"text\":\"" + title + "\"}");
27 | Object chatSubtitle = a.invoke(null,"{\"text\":\"" + subtitle + "\"}");
28 |
29 | Object timeTitlePacket = timeTitleConstructor.newInstance(enumTIMES, null, fadeIn, stay, fadeOut);
30 | Object titlePacket = textTitleConstructor.newInstance(enumTITLE, chatTitle);
31 | Object subtitlePacket = textTitleConstructor.newInstance(enumSUBTITLE, chatSubtitle);
32 |
33 | ReflectionUtils.sendPacket(player, timeTitlePacket);
34 | ReflectionUtils.sendPacket(player, titlePacket);
35 | ReflectionUtils.sendPacket(player, subtitlePacket);
36 |
37 | } else {
38 |
39 | Class> playerClass = player.getClass();
40 | Method sendTitle = playerClass.getMethod("sendTitle", String.class, String.class, int.class, int.class, int.class);
41 | sendTitle.invoke(player, title, subtitle, fadeIn, stay, fadeOut);
42 |
43 | }
44 |
45 | } catch (Throwable e) {
46 | e.printStackTrace();
47 | }
48 | }
49 |
50 | public static void broadcastTitle(Integer fadeIn, Integer stay, Integer fadeOut, String title, String subtitle) {
51 | try
52 | {
53 |
54 | if (Main.getVersion().value < 17) {
55 | Object chatTitle = a.invoke(null, "{\"text\":\"" + title + "\"}");
56 | Object chatSubtitle = a.invoke(null,"{\"text\":\"" + subtitle + "\"}");
57 |
58 | Object timeTitlePacket = timeTitleConstructor.newInstance(enumTIMES, null, fadeIn, stay, fadeOut);
59 | Object titlePacket = textTitleConstructor.newInstance(enumTITLE, chatTitle);
60 | Object subtitlePacket = textTitleConstructor.newInstance(enumSUBTITLE, chatSubtitle);
61 |
62 | for (Player player : Bukkit.getOnlinePlayers()) {
63 | ReflectionUtils.sendPacket(player, timeTitlePacket);
64 | ReflectionUtils.sendPacket(player, titlePacket);
65 | ReflectionUtils.sendPacket(player, subtitlePacket);
66 | }
67 |
68 | } else {
69 |
70 | for (Player player : Bukkit.getOnlinePlayers()) {
71 | Class> playerClass = player.getClass();
72 | Method sendTitle = playerClass.getMethod("sendTitle", String.class, String.class, int.class, int.class, int.class);
73 | sendTitle.invoke(player, title, subtitle, fadeIn, stay, fadeOut);
74 | }
75 |
76 | }
77 |
78 | }
79 | catch (Throwable e) {
80 | e.printStackTrace();
81 | }
82 | }
83 |
84 | static void load() {
85 | try
86 | {
87 | if (Main.getVersion().value < 17) {
88 | Class> icbc = ReflectionUtils.getNMSClass("IChatBaseComponent");
89 | Class> ppot = ReflectionUtils.getNMSClass("PacketPlayOutTitle");
90 | Class> enumClass;
91 |
92 | if (ppot.getDeclaredClasses().length > 0) {
93 | enumClass = ppot.getDeclaredClasses()[0];
94 | } else {
95 | enumClass = ReflectionUtils.getNMSClass("EnumTitleAction");
96 | }
97 |
98 | if (icbc.getDeclaredClasses().length > 0) {
99 | a = icbc.getDeclaredClasses()[0].getMethod("a", String.class);
100 | } else {
101 | a = ReflectionUtils.getNMSClass("ChatSerializer").getMethod("a", String.class);
102 | }
103 |
104 | enumTIMES = enumClass.getField("TIMES").get(null);
105 | enumTITLE = enumClass.getField("TITLE").get(null);
106 | enumSUBTITLE = enumClass.getField("SUBTITLE").get(null);
107 | timeTitleConstructor = ppot.getConstructor(enumClass, icbc, int.class, int.class, int.class);
108 | textTitleConstructor = ppot.getConstructor(enumClass, icbc);
109 | }
110 | }
111 | catch (Throwable e) {}
112 | }
113 | }
--------------------------------------------------------------------------------
/src/rush/utils/serializer/Serializer.java:
--------------------------------------------------------------------------------
1 | package rush.utils.serializer;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.ByteArrayOutputStream;
5 | import java.io.DataInputStream;
6 | import java.io.DataOutput;
7 | import java.io.DataOutputStream;
8 | import java.lang.reflect.Constructor;
9 | import java.math.BigInteger;
10 |
11 | import org.bukkit.Material;
12 | import org.bukkit.inventory.ItemStack;
13 | import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
14 |
15 | import rush.utils.ReflectionUtils;
16 | import rush.utils.objectStream.BukkitObjectInputStream;
17 | import rush.utils.objectStream.BukkitObjectOutputStream;
18 |
19 | public class Serializer {
20 |
21 | public static ItemStack deserializeItemStack(String data) {
22 | ByteArrayInputStream inputStream = new ByteArrayInputStream(new BigInteger(data, 32).toByteArray());
23 | DataInputStream dataInputStream = new DataInputStream(inputStream);
24 |
25 | ItemStack itemStack = null;
26 | try {
27 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
28 | Class> nmsItemStackClass = ReflectionUtils.getNMSClass("ItemStack");
29 | Object nbtTagCompound = ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", DataInputStream.class).invoke(null, dataInputStream);
30 | Object craftItemStack = nmsItemStackClass.getMethod("createStack", nbtTagCompoundClass).invoke(null, nbtTagCompound);
31 | itemStack = (ItemStack) ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asBukkitCopy", nmsItemStackClass).invoke(null, craftItemStack);
32 | } catch (Throwable e) {
33 | e.printStackTrace();
34 | }
35 |
36 | return itemStack;
37 | }
38 |
39 | public static ItemStack[] deserializeListItemStack(String itens) {
40 | ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(itens));
41 | BukkitObjectInputStream dataInput;
42 |
43 | try {
44 | dataInput = new BukkitObjectInputStream(inputStream);
45 | int size = dataInput.readInt();
46 | ItemStack[] list = new ItemStack[size];
47 |
48 | for (int i = 0; i < size; i++) {
49 | Object utf = dataInput.readObject();
50 | int slot = dataInput.readInt();
51 | if (utf != null) list[slot] = deserializeItemStack((String) utf);
52 | }
53 |
54 | dataInput.close();
55 | return list;
56 | } catch (Throwable e) {
57 | e.printStackTrace();
58 | }
59 |
60 | return null;
61 | }
62 |
63 | public static String serializeItemStack(ItemStack item) {
64 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
65 | DataOutputStream dataOutput = new DataOutputStream(outputStream);
66 |
67 | try {
68 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
69 | Constructor> nbtTagCompoundConstructor = nbtTagCompoundClass.getConstructor();
70 | Object nbtTagCompound = nbtTagCompoundConstructor.newInstance();
71 | Object nmsItemStack = ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asNMSCopy", ItemStack.class).invoke(null, item);
72 | ReflectionUtils.getNMSClass("ItemStack").getMethod("save", nbtTagCompoundClass).invoke(nmsItemStack, nbtTagCompound);
73 | ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", nbtTagCompoundClass, DataOutput.class).invoke(null, nbtTagCompound, (DataOutput) dataOutput);
74 | } catch (Throwable e) {
75 | e.printStackTrace();
76 | }
77 |
78 | return new BigInteger(1, outputStream.toByteArray()).toString(32);
79 | }
80 |
81 | public static String serializeListItemStack(ItemStack[] itens) {
82 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
83 | BukkitObjectOutputStream dataOutput;
84 |
85 | try {
86 | dataOutput = new BukkitObjectOutputStream(outputStream);
87 | dataOutput.writeInt(itens.length);
88 |
89 | int index = 0;
90 | for (ItemStack is : itens) {
91 | if (is != null && is.getType() != Material.AIR) {
92 | dataOutput.writeObject(serializeItemStack(is));
93 | } else {
94 | dataOutput.writeObject(null);
95 | }
96 | dataOutput.writeInt(index);
97 | index++;
98 | }
99 |
100 | dataOutput.close();
101 | } catch (Throwable e) {
102 | e.printStackTrace();
103 | }
104 |
105 | return Base64Coder.encodeLines(outputStream.toByteArray());
106 | }
107 |
108 | }
--------------------------------------------------------------------------------
/src/rush/utils/serializer/SerializerNEW.java:
--------------------------------------------------------------------------------
1 | package rush.utils.serializer;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.ByteArrayOutputStream;
5 | import java.io.DataInputStream;
6 | import java.io.DataOutput;
7 | import java.io.DataOutputStream;
8 | import java.lang.reflect.Constructor;
9 | import java.math.BigInteger;
10 |
11 | import org.bukkit.Material;
12 | import org.bukkit.inventory.ItemStack;
13 | import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
14 |
15 | import rush.utils.ReflectionUtils;
16 | import rush.utils.objectStream.BukkitObjectInputStream;
17 | import rush.utils.objectStream.BukkitObjectOutputStream;
18 |
19 | public class SerializerNEW {
20 |
21 | public static ItemStack deserializeItemStack(String data) {
22 | ByteArrayInputStream inputStream = new ByteArrayInputStream(new BigInteger(data, 32).toByteArray());
23 | DataInputStream dataInputStream = new DataInputStream(inputStream);
24 |
25 | ItemStack itemStack = null;
26 | try {
27 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
28 | Class> nmsItemStackClass = ReflectionUtils.getNMSClass("ItemStack");
29 | Object nbtTagCompound = ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", DataInputStream.class).invoke(null, dataInputStream);
30 | Constructor> craftItemStackConstructor = nmsItemStackClass.getDeclaredConstructor(nbtTagCompoundClass);
31 | craftItemStackConstructor.setAccessible(true);
32 | Object craftItemStack = craftItemStackConstructor.newInstance(nbtTagCompound);
33 | itemStack = (ItemStack) ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asBukkitCopy", nmsItemStackClass).invoke(null, craftItemStack);
34 | } catch (Throwable e) {
35 | e.printStackTrace();
36 | }
37 |
38 | return itemStack;
39 | }
40 |
41 | public static ItemStack[] deserializeListItemStack(String itens) {
42 | ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(itens));
43 | BukkitObjectInputStream dataInput;
44 |
45 | try {
46 | dataInput = new BukkitObjectInputStream(inputStream);
47 | int size = dataInput.readInt();
48 | ItemStack[] list = new ItemStack[size];
49 |
50 | for (int i = 0; i < size; i++) {
51 | Object utf = dataInput.readObject();
52 | int slot = dataInput.readInt();
53 | if (utf != null) list[slot] = deserializeItemStack((String) utf);
54 | }
55 |
56 | dataInput.close();
57 | return list;
58 | } catch (Throwable e) {
59 | e.printStackTrace();
60 | }
61 |
62 | return null;
63 | }
64 |
65 | public static String serializeItemStack(ItemStack item) {
66 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
67 | DataOutputStream dataOutput = new DataOutputStream(outputStream);
68 |
69 | try {
70 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
71 | Constructor> nbtTagCompoundConstructor = nbtTagCompoundClass.getConstructor();
72 | Object nbtTagCompound = nbtTagCompoundConstructor.newInstance();
73 | Object nmsItemStack = ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asNMSCopy", ItemStack.class).invoke(null, item);
74 | ReflectionUtils.getNMSClass("ItemStack").getMethod("save", nbtTagCompoundClass).invoke(nmsItemStack, nbtTagCompound);
75 | ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", nbtTagCompoundClass, DataOutput.class).invoke(null, nbtTagCompound, (DataOutput) dataOutput);
76 | } catch (Throwable e) {
77 | e.printStackTrace();
78 | }
79 |
80 | return new BigInteger(1, outputStream.toByteArray()).toString(32);
81 | }
82 |
83 | public static String serializeListItemStack(ItemStack[] itens) {
84 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
85 | BukkitObjectOutputStream dataOutput;
86 |
87 | try {
88 | dataOutput = new BukkitObjectOutputStream(outputStream);
89 | dataOutput.writeInt(itens.length);
90 |
91 | int index = 0;
92 | for (ItemStack is : itens) {
93 | if (is != null && is.getType() != Material.AIR) {
94 | dataOutput.writeObject(serializeItemStack(is));
95 | } else {
96 | dataOutput.writeObject(null);
97 | }
98 | dataOutput.writeInt(index);
99 | index++;
100 | }
101 |
102 | dataOutput.close();
103 | } catch (Throwable e) {
104 | e.printStackTrace();
105 | }
106 |
107 | return Base64Coder.encodeLines(outputStream.toByteArray());
108 | }
109 |
110 | }
--------------------------------------------------------------------------------
/src/rush/apis/AnvilAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Constructor;
4 | import java.lang.reflect.Field;
5 | import java.lang.reflect.Method;
6 |
7 | import org.bukkit.Location;
8 | import org.bukkit.entity.Player;
9 |
10 | import rush.Main;
11 | import rush.utils.ReflectionUtils;
12 |
13 | public class AnvilAPI {
14 |
15 | private static Constructor> containerAnvilConstructor;
16 | private static Constructor> blockPositionConstructor;
17 | private static Constructor> packetConstructor;
18 | private static Method nextContainerCounter;
19 | private static Method addSlotListener;
20 | private static Method getHandle;
21 | private static Object message;
22 | private static Field windowId;
23 | private static Field worldField;
24 | private static Field inventoryField;
25 | private static Field checkReachableField;
26 | private static Field activeContainerField;
27 |
28 | public static void openAnvil(Player p) {
29 | try {
30 | Location l = p.getLocation();
31 | int x = l.getBlockX();
32 | int y = l.getBlockY();
33 | int z = l.getBlockZ();
34 |
35 | Object packet;
36 | Object container;
37 | Object entityPlayer = getHandle.invoke(p);
38 | Object world = worldField.get(entityPlayer);
39 | Object inventory = inventoryField.get(entityPlayer);
40 | Object counter = nextContainerCounter.invoke(entityPlayer);
41 |
42 | if (!Main.isOldVersion()) {
43 | Object blockPosition = blockPositionConstructor.newInstance(x, y, z);
44 | container = containerAnvilConstructor.newInstance(inventory, world, blockPosition, entityPlayer);
45 | packet = packetConstructor.newInstance(counter, "minecraft:anvil", message);
46 | } else {
47 | container = containerAnvilConstructor.newInstance(inventory, world, x, y, z, entityPlayer);
48 | packet = packetConstructor.newInstance(counter, 8, "Repairing", 9, false);
49 | }
50 |
51 | ReflectionUtils.sendPacket(p, packet);
52 |
53 | windowId.set(container, counter);
54 | checkReachableField.set(container, false);
55 | activeContainerField.set(entityPlayer, container);
56 | addSlotListener.invoke(container, entityPlayer);
57 | } catch (Throwable e) {
58 | e.printStackTrace();
59 | }
60 | }
61 |
62 | static void load() {
63 | try
64 | {
65 | Class> craftPlayerClass = ReflectionUtils.getOBClass("entity.CraftPlayer");
66 | Class> entityPlayerClass = ReflectionUtils.getNMSClass("EntityPlayer");
67 | Class> containerAnvilClass = ReflectionUtils.getNMSClass("ContainerAnvil");
68 |
69 | getHandle = craftPlayerClass.getMethod("getHandle");
70 | nextContainerCounter = entityPlayerClass.getMethod("nextContainerCounter");
71 |
72 | worldField = entityPlayerClass.getField("world");
73 | inventoryField = entityPlayerClass.getField("inventory");
74 | activeContainerField = entityPlayerClass.getField("activeContainer");
75 | checkReachableField = containerAnvilClass.getField("checkReachable");
76 | windowId = containerAnvilClass.getField("windowId");
77 |
78 | Class> icraftingClass = ReflectionUtils.getNMSClass("ICrafting");
79 | Class> containerClass = ReflectionUtils.getNMSClass("Container");
80 | addSlotListener = containerClass.getMethod("addSlotListener", icraftingClass);
81 |
82 | Class> playerInventoryClass = ReflectionUtils.getNMSClass("PlayerInventory");
83 | Class> worldClass = ReflectionUtils.getNMSClass("World");
84 | Class> entityHumanClass = ReflectionUtils.getNMSClass("EntityHuman");
85 | if (!Main.isOldVersion()) {
86 | Class> blockPositionClass = ReflectionUtils.getNMSClass("BlockPosition");
87 | blockPositionConstructor = blockPositionClass.getConstructor(int.class, int.class, int.class);
88 | containerAnvilConstructor = containerAnvilClass.getConstructor(playerInventoryClass, worldClass, blockPositionClass, entityHumanClass);
89 | } else {
90 | containerAnvilConstructor = containerAnvilClass.getConstructor(playerInventoryClass, worldClass, int.class, int.class, int.class, entityHumanClass);
91 | }
92 |
93 | Class> packetOpenWindowClass;
94 | if (Main.isVeryOldVersion()) {
95 | packetOpenWindowClass = ReflectionUtils.getNMSClass("Packet100OpenWindow");
96 | } else {
97 | packetOpenWindowClass = ReflectionUtils.getNMSClass("PacketPlayOutOpenWindow");
98 | }
99 |
100 | if (!Main.isOldVersion()) {
101 | Class> icbc = ReflectionUtils.getNMSClass("IChatBaseComponent");
102 | Class> cm = ReflectionUtils.getNMSClass("ChatMessage");
103 | Constructor> messageConstrutor = cm.getConstructor(String.class, Object[].class);
104 | packetConstructor = packetOpenWindowClass.getConstructor(int.class, String.class, icbc);
105 | message = messageConstrutor.newInstance("Repairing", new Object[] {});
106 | } else {
107 | packetConstructor = packetOpenWindowClass.getConstructor(int.class, int.class, String.class, int.class, boolean.class);
108 | }
109 | }
110 | catch (Throwable e) {}
111 | }
112 |
113 | }
--------------------------------------------------------------------------------
/src/rush/utils/serializer/SerializerVeryNEW.java:
--------------------------------------------------------------------------------
1 | package rush.utils.serializer;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.ByteArrayOutputStream;
5 | import java.io.DataInput;
6 | import java.io.DataInputStream;
7 | import java.io.DataOutput;
8 | import java.io.DataOutputStream;
9 | import java.lang.reflect.Constructor;
10 | import java.math.BigInteger;
11 |
12 | import org.bukkit.Material;
13 | import org.bukkit.inventory.ItemStack;
14 | import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
15 |
16 | import rush.utils.ReflectionUtils;
17 | import rush.utils.objectStream.BukkitObjectInputStream;
18 | import rush.utils.objectStream.BukkitObjectOutputStream;
19 |
20 | public class SerializerVeryNEW {
21 |
22 | public static ItemStack deserializeItemStack(String data) {
23 | ByteArrayInputStream inputStream = new ByteArrayInputStream(new BigInteger(data, 32).toByteArray());
24 | DataInput dataInputStream = new DataInputStream(inputStream);
25 |
26 | ItemStack itemStack = null;
27 | try {
28 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
29 | Class> nmsItemStackClass = ReflectionUtils.getNMSClass("ItemStack");
30 | Object nbtTagCompound = ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", DataInput.class).invoke(null, dataInputStream);
31 | Constructor> craftItemStackConstructor = nmsItemStackClass.getDeclaredConstructor(nbtTagCompoundClass);
32 | craftItemStackConstructor.setAccessible(true);
33 | Object craftItemStack = craftItemStackConstructor.newInstance(nbtTagCompound);
34 | itemStack = (ItemStack) ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asBukkitCopy", nmsItemStackClass).invoke(null, craftItemStack);
35 | } catch (Throwable e) {
36 | e.printStackTrace();
37 | }
38 |
39 | return itemStack;
40 | }
41 |
42 | public static ItemStack[] deserializeListItemStack(String itens) {
43 | ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(itens));
44 | BukkitObjectInputStream dataInput;
45 |
46 | try {
47 | dataInput = new BukkitObjectInputStream(inputStream);
48 | int size = dataInput.readInt();
49 | ItemStack[] list = new ItemStack[size];
50 |
51 | for (int i = 0; i < size; i++) {
52 | Object utf = dataInput.readObject();
53 | int slot = dataInput.readInt();
54 | if (utf != null) list[slot] = deserializeItemStack((String) utf);
55 | }
56 |
57 | dataInput.close();
58 | return list;
59 | } catch (Throwable e) {
60 | e.printStackTrace();
61 | }
62 |
63 | return null;
64 | }
65 |
66 | public static String serializeItemStack(ItemStack item) {
67 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
68 | DataOutputStream dataOutput = new DataOutputStream(outputStream);
69 |
70 | try {
71 | Class> nbtTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
72 | Constructor> nbtTagCompoundConstructor = nbtTagCompoundClass.getConstructor();
73 | Object nbtTagCompound = nbtTagCompoundConstructor.newInstance();
74 | Object nmsItemStack = ReflectionUtils.getOBClass("inventory.CraftItemStack").getMethod("asNMSCopy", ItemStack.class).invoke(null, item);
75 | ReflectionUtils.getNMSClass("ItemStack").getMethod("save", nbtTagCompoundClass).invoke(nmsItemStack, nbtTagCompound);
76 | ReflectionUtils.getNMSClass("NBTCompressedStreamTools").getMethod("a", nbtTagCompoundClass, DataOutput.class).invoke(null, nbtTagCompound, (DataOutput) dataOutput);
77 | } catch (Throwable e) {
78 | e.printStackTrace();
79 | }
80 |
81 | return new BigInteger(1, outputStream.toByteArray()).toString(32);
82 | }
83 |
84 | public static String serializeListItemStack(ItemStack[] itens) {
85 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
86 | BukkitObjectOutputStream dataOutput;
87 |
88 | try {
89 | dataOutput = new BukkitObjectOutputStream(outputStream);
90 | dataOutput.writeInt(itens.length);
91 |
92 | int index = 0;
93 | for (ItemStack is : itens) {
94 | if (is != null && is.getType() != Material.AIR) {
95 | dataOutput.writeObject(serializeItemStack(is));
96 | } else {
97 | dataOutput.writeObject(null);
98 | }
99 | dataOutput.writeInt(index);
100 | index++;
101 | }
102 |
103 | dataOutput.close();
104 | } catch (Throwable e) {
105 | e.printStackTrace();
106 | }
107 |
108 | return Base64Coder.encodeLines(outputStream.toByteArray());
109 | }
110 |
111 | }
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
3 | org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
4 | org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
5 | org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
6 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
7 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
8 | org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
9 | org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
10 | org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
13 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
14 | org.eclipse.jdt.core.compiler.compliance=1.8
15 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
16 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
17 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
18 | org.eclipse.jdt.core.compiler.problem.APILeak=warning
19 | org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
20 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
21 | org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
22 | org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
23 | org.eclipse.jdt.core.compiler.problem.deadCode=warning
24 | org.eclipse.jdt.core.compiler.problem.deprecation=warning
25 | org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
26 | org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
27 | org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
28 | org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
29 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
30 | org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
31 | org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
32 | org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
33 | org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
34 | org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
35 | org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
36 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
37 | org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
38 | org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
39 | org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
40 | org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
41 | org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
42 | org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
43 | org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
44 | org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
45 | org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
46 | org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
47 | org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
48 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
49 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
50 | org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
51 | org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
52 | org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
53 | org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
54 | org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
55 | org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
56 | org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
57 | org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
58 | org.eclipse.jdt.core.compiler.problem.nullReference=warning
59 | org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
60 | org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
61 | org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
62 | org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
63 | org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
64 | org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
65 | org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
66 | org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
67 | org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
68 | org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
69 | org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
70 | org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
71 | org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
72 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
73 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
74 | org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
75 | org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
76 | org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
77 | org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
78 | org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
79 | org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
80 | org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
81 | org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
82 | org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
83 | org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
84 | org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
85 | org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
86 | org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
87 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
88 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
89 | org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
90 | org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
91 | org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
92 | org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
93 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
94 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
95 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
96 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
97 | org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
98 | org.eclipse.jdt.core.compiler.problem.unusedImport=warning
99 | org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
100 | org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
101 | org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
102 | org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
103 | org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
104 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
105 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
106 | org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
107 | org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
108 | org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
109 | org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
110 | org.eclipse.jdt.core.compiler.source=1.8
111 |
--------------------------------------------------------------------------------
/src/rush/apis/ItemAPI.java:
--------------------------------------------------------------------------------
1 | package rush.apis;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 | import java.util.Map;
6 | import java.util.Random;
7 |
8 | import org.bukkit.inventory.ItemStack;
9 |
10 | import rush.Main;
11 | import rush.utils.ReflectionUtils;
12 |
13 | public class ItemAPI {
14 |
15 | private static Class> ItemStackClass;
16 | private static Class> CraftItemStackClass;
17 | private static Class> NBTTagCompoundClass;
18 | private static Class> NBTTagListClass;
19 | private static Class> NBTTagStringClass;
20 | private static Class> NBTTagIntClass;
21 | private static Class> NBTTagDoubleClass;
22 | private static Method asNMSCopy;
23 | private static Method asBukkitCopy;
24 | private static Method asCraftMirror;
25 | private static Method getRepairCost;
26 | private static Method setRepairCost;
27 | private static Method setNBTTagCompound;
28 | private static Method hasNBTTagCompound;
29 | private static Method getNBTTagCompound;
30 | private static Method hasKey;
31 | private static Method removeKey;
32 | private static Method getString;
33 | private static Method getBoolean;
34 | private static Method setString;
35 | private static Method setBoolean;
36 | private static Method getNBTBase;
37 | private static Method getNBTList;
38 | private static Method hasTag;
39 | private static Method setNBTBaseCompound;
40 | private static Method addNBTBaseTag;
41 | private static Method createTag;
42 | private static Field map;
43 |
44 | public static ItemStack setAttributeNBT(ItemStack item, String attribute, double value, int operation) {
45 | int least = new Random().nextInt(8192);
46 | int most = new Random().nextInt(8192);
47 | try {
48 | Object NBTTagCompound;
49 | Object CraftItemStack = asNMSCopy.invoke(null, item);
50 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
51 | if (hasNBTTag) {
52 | NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
53 | } else {
54 | NBTTagCompound = NBTTagCompoundClass.newInstance();
55 | }
56 |
57 | Object AttributeModifiers;
58 | Object Modifier = NBTTagCompoundClass.newInstance();
59 | boolean hasAttribute = (boolean) hasTag.invoke(NBTTagCompound, "AttributeModifiers");
60 | if (hasAttribute) {
61 | AttributeModifiers = getNBTList.invoke(NBTTagCompound, "AttributeModifiers", 10);
62 | } else {
63 | AttributeModifiers = NBTTagListClass.newInstance();
64 | }
65 |
66 | Object AttributeName = createTag.invoke(null, (byte) 8);
67 | Field fieldAttributeName = NBTTagStringClass.getDeclaredField("data");
68 | fieldAttributeName.setAccessible(true);
69 | fieldAttributeName.set(AttributeName, attribute);
70 |
71 | Object Name = createTag.invoke(null, (byte) 8);
72 | Field fieldName = NBTTagStringClass.getDeclaredField("data");
73 | fieldName.setAccessible(true);
74 | fieldName.set(Name, attribute);
75 |
76 | Object Amount = createTag.invoke(null, (byte) 6);
77 | Field fieldAmount = NBTTagDoubleClass.getDeclaredField("data");
78 | fieldAmount.setAccessible(true);
79 | fieldAmount.set(Amount, value);
80 |
81 | Object Operation = createTag.invoke(null, (byte) 3);
82 | Field fieldOperation = NBTTagIntClass.getDeclaredField("data");
83 | fieldOperation.setAccessible(true);
84 | fieldOperation.set(Operation, operation);
85 |
86 | Object UUIDLeast = createTag.invoke(null, (byte) 3);
87 | Field fieldUUIDLeast = NBTTagIntClass.getDeclaredField("data");
88 | fieldUUIDLeast.setAccessible(true);
89 | fieldUUIDLeast.set(UUIDLeast, least);
90 |
91 | Object UUIDMost = createTag.invoke(null, (byte) 3);
92 | Field fieldUUIDMost = NBTTagIntClass.getDeclaredField("data");
93 | fieldUUIDMost.setAccessible(true);
94 | fieldUUIDMost.set(UUIDMost, most);
95 |
96 | setNBTBaseCompound.invoke(Modifier, "AttributeName", AttributeName);
97 | setNBTBaseCompound.invoke(Modifier, "Name", Name);
98 | setNBTBaseCompound.invoke(Modifier, "Amount", Amount);
99 | setNBTBaseCompound.invoke(Modifier, "Operation", Operation);
100 | setNBTBaseCompound.invoke(Modifier, "UUIDLeast", UUIDLeast);
101 | setNBTBaseCompound.invoke(Modifier, "UUIDMost", UUIDMost);
102 |
103 | Object NBTBase = getNBTBase.invoke(Modifier);
104 | if (Main.isVeryFuckingNewVersion()) {
105 | addNBTBaseTag.invoke(AttributeModifiers, 0, NBTBase);
106 | } else {
107 | addNBTBaseTag.invoke(AttributeModifiers, NBTBase);
108 | }
109 | setNBTBaseCompound.invoke(NBTTagCompound, "AttributeModifiers", AttributeModifiers);
110 | setNBTTagCompound.invoke(CraftItemStack, NBTTagCompound);
111 |
112 | return (ItemStack) asCraftMirror.invoke(null, CraftItemStack);
113 | } catch (Throwable e) {
114 | e.printStackTrace();
115 | return null;
116 | }
117 | }
118 |
119 | public static boolean hasInfo(ItemStack item, String key) {
120 | try {
121 | Object CraftItemStack = asNMSCopy.invoke(null, item);
122 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
123 | if (hasNBTTag) {
124 | Object NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
125 | return (boolean) hasKey.invoke(NBTTagCompound, key);
126 | }
127 | return false;
128 | } catch (Throwable e) {
129 | e.printStackTrace();
130 | return false;
131 | }
132 | }
133 |
134 | public static String getInfo(ItemStack item, String key) {
135 | try {
136 | Object CraftItemStack = asNMSCopy.invoke(null, item);
137 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
138 | if (hasNBTTag) {
139 | Object NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
140 | return getString.invoke(NBTTagCompound, key).toString();
141 | }
142 | return null;
143 | } catch (Throwable e) {
144 | e.printStackTrace();
145 | return null;
146 | }
147 | }
148 |
149 | public static ItemStack saveInfo(ItemStack item, String key, String value) {
150 | try {
151 | Object NBTTagCompound;
152 | Object CraftItemStack = asNMSCopy.invoke(null, item);
153 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
154 | if (hasNBTTag) {
155 | NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
156 | } else {
157 | NBTTagCompound = NBTTagCompoundClass.newInstance();
158 | }
159 | setString.invoke(NBTTagCompound, key, value);
160 | setNBTTagCompound.invoke(CraftItemStack, NBTTagCompound);
161 | return (ItemStack) asCraftMirror.invoke(null, CraftItemStack);
162 | } catch (Throwable e) {
163 | e.printStackTrace();
164 | return null;
165 | }
166 | }
167 |
168 | public static ItemStack removeInfo(ItemStack item, String key) {
169 | try {
170 | Object NBTTagCompound;
171 | Object CraftItemStack = asNMSCopy.invoke(null, item);
172 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
173 | if (hasNBTTag) {
174 | NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
175 | } else {
176 | NBTTagCompound = NBTTagCompoundClass.newInstance();
177 | }
178 | removeKey.invoke(NBTTagCompound, key);
179 | setNBTTagCompound.invoke(CraftItemStack, NBTTagCompound);
180 | return (ItemStack) asCraftMirror.invoke(null, CraftItemStack);
181 | } catch (Throwable e) {
182 | e.printStackTrace();
183 | return null;
184 | }
185 | }
186 |
187 | @SuppressWarnings("unchecked")
188 | public static Map getInfos(ItemStack item) {
189 | try {
190 | Object CraftItemStack = asNMSCopy.invoke(null, item);
191 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
192 | if (hasNBTTag) {
193 | Object NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
194 | return (Map) map.get(NBTTagCompound);
195 | }
196 | return null;
197 | } catch (Throwable e) {
198 | e.printStackTrace();
199 | return null;
200 | }
201 | }
202 | public static boolean isUnbreakable(ItemStack item) {
203 | try {
204 | Object NBTTagCompound;
205 | Object CraftItemStack = asNMSCopy.invoke(null, item);
206 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
207 | if (hasNBTTag) {
208 | NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
209 | } else {
210 | return false;
211 | }
212 | return (boolean) getBoolean.invoke(NBTTagCompound, "Unbreakable");
213 | } catch (Throwable e) {
214 | e.printStackTrace();
215 | return false;
216 | }
217 | }
218 |
219 | public static ItemStack setUnbreakable(ItemStack item, boolean bool) {
220 | if (item.getType().getMaxDurability() != 0 && item.getDurability() != 0) {
221 | item.setDurability((short) 0);
222 | }
223 | try {
224 | Object NBTTagCompound;
225 | Object CraftItemStack = asNMSCopy.invoke(null, item);
226 | boolean hasNBTTag = (boolean) hasNBTTagCompound.invoke(CraftItemStack);
227 | if (hasNBTTag) {
228 | NBTTagCompound = getNBTTagCompound.invoke(CraftItemStack);
229 | } else {
230 | NBTTagCompound = NBTTagCompoundClass.newInstance();
231 | }
232 | setBoolean.invoke(NBTTagCompound, "Unbreakable", true);
233 | setNBTTagCompound.invoke(CraftItemStack, NBTTagCompound);
234 | return (ItemStack) asCraftMirror.invoke(null, CraftItemStack);
235 | } catch (Throwable e) {
236 | e.printStackTrace();
237 | return null;
238 | }
239 | }
240 |
241 | public static int getRepairCost(ItemStack item) {
242 | try {
243 | Object CraftItemStack = asNMSCopy.invoke(null, item);
244 | int cost = (int) getRepairCost.invoke(CraftItemStack);
245 | if (item.getType().getMaxDurability() != 0) {
246 | double durability = item.getDurability();
247 | double maxDurability = item.getType().getMaxDurability();
248 | double durabilityPercent = (durability * 100.0) / maxDurability;
249 | if (durabilityPercent <= 25.0) cost += 1;
250 | else if (durabilityPercent <= 50.0) cost += 2;
251 | else if (durabilityPercent <= 75.0) cost += 3;
252 | else if (durabilityPercent <= 100.0) cost += 4;
253 | }
254 | return cost;
255 | } catch (Throwable e) {
256 | e.printStackTrace();
257 | return 40;
258 | }
259 | }
260 |
261 | public static ItemStack setRepairCost(ItemStack item, int cost) {
262 | try {
263 | Object CraftItemStack = asNMSCopy.invoke(null, item);
264 | setRepairCost.invoke(CraftItemStack, cost);
265 | return (ItemStack) asBukkitCopy.invoke(null, CraftItemStack);
266 | } catch (Throwable e) {
267 | e.printStackTrace();
268 | return item;
269 | }
270 | }
271 |
272 | static void load() {
273 | try
274 | {
275 | // Item Classes
276 | ItemStackClass = ReflectionUtils.getNMSClass("ItemStack");
277 | CraftItemStackClass = ReflectionUtils.getOBClass("inventory.CraftItemStack");
278 |
279 | // NBTTag Classes
280 | NBTTagCompoundClass = ReflectionUtils.getNMSClass("NBTTagCompound");
281 | NBTTagListClass = ReflectionUtils.getNMSClass("NBTTagList");
282 | NBTTagStringClass = ReflectionUtils.getNMSClass("NBTTagString");
283 | NBTTagIntClass = ReflectionUtils.getNMSClass("NBTTagInt");
284 | NBTTagDoubleClass = ReflectionUtils.getNMSClass("NBTTagDouble");
285 | Class> NBTBaseClass = ReflectionUtils.getNMSClass("NBTBase");
286 |
287 | // Item Handle Methods
288 | asNMSCopy = CraftItemStackClass.getDeclaredMethod("asNMSCopy", ItemStack.class);
289 | asBukkitCopy = CraftItemStackClass.getDeclaredMethod("asBukkitCopy", ItemStackClass);
290 | asCraftMirror = CraftItemStackClass.getDeclaredMethod("asCraftMirror", ItemStackClass);
291 |
292 | // Repair cost Methods
293 | getRepairCost = ItemStackClass.getDeclaredMethod("getRepairCost");
294 | setRepairCost = ItemStackClass.getMethod("setRepairCost", int.class);
295 |
296 | // Item NBTTag Methods
297 | getNBTTagCompound = ItemStackClass.getDeclaredMethod("getTag");
298 | hasNBTTagCompound = ItemStackClass.getDeclaredMethod("hasTag");
299 | setNBTTagCompound = ItemStackClass.getDeclaredMethod("setTag", NBTTagCompoundClass);
300 |
301 | // Basic NBTTag Handle Methods
302 | hasKey = NBTTagCompoundClass.getDeclaredMethod("hasKey", String.class);
303 | removeKey = NBTTagCompoundClass.getDeclaredMethod("remove", String.class);
304 | getString = NBTTagCompoundClass.getDeclaredMethod("getString", String.class);
305 | getBoolean = NBTTagCompoundClass.getDeclaredMethod("getBoolean", String.class);
306 | setString = NBTTagCompoundClass.getDeclaredMethod("setString", String.class, String.class);
307 | setBoolean = NBTTagCompoundClass.getDeclaredMethod("setBoolean", String.class, boolean.class);
308 |
309 | // Item NBTTagCompound Field
310 | map = NBTTagCompoundClass.getDeclaredField("map");
311 | map.setAccessible(true);
312 |
313 | // Advance NBTTag Handle
314 | getNBTBase = NBTTagCompoundClass.getDeclaredMethod("clone");
315 | getNBTList = NBTTagCompoundClass.getDeclaredMethod("getList", String.class, int.class);
316 | hasTag = NBTTagCompoundClass.getDeclaredMethod("hasKey", String.class);
317 | setNBTBaseCompound = NBTTagCompoundClass.getDeclaredMethod("set", String.class, NBTBaseClass);
318 | createTag = NBTBaseClass.getDeclaredMethod("createTag", byte.class);
319 | createTag.setAccessible(true);
320 | if (Main.isVeryFuckingNewVersion()) {
321 | addNBTBaseTag = NBTTagListClass.getDeclaredMethod("b", int.class, NBTBaseClass);
322 | } else {
323 | addNBTBaseTag = NBTTagListClass.getDeclaredMethod("add", NBTBaseClass);
324 | }
325 |
326 | }
327 | catch (Throwable e) {}
328 | }
329 |
330 | }
--------------------------------------------------------------------------------
/bin/comandos.yml:
--------------------------------------------------------------------------------
1 | file-version: 6
2 | comandos:
3 | alerta:
4 | ativar-comando: true
5 | aliases: []
6 | descricao: "Envia uma alerta para todos do servidor."
7 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
8 |
9 | back:
10 | ativar-comando: true
11 | aliases: []
12 | descricao: "Volta ao local anterior do seu teleporte."
13 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
14 |
15 | bigorna:
16 | ativar-comando: true
17 | aliases: []
18 | descricao: "Abre uma bigorna virtual."
19 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
20 |
21 | chapeu:
22 | ativar-comando: true
23 | aliases: [hat]
24 | descricao: "Veste o chapéu que esta na sua mão."
25 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
26 |
27 | clear:
28 | ativar-comando: true
29 | aliases: []
30 | descricao: "Limpa completamente seu inventario."
31 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
32 |
33 | clearchat:
34 | ativar-comando: true
35 | aliases: []
36 | descricao: "Limpa o chat do servidor."
37 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
38 |
39 | compactar:
40 | ativar-comando: true
41 | aliases: [block, condense]
42 | descricao: "Compactar todos os itens do inventario."
43 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
44 |
45 | cores:
46 | ativar-comando: true
47 | aliases: [colors]
48 | descricao: "Mostra a lista de cores do minecraft."
49 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
50 |
51 | craft:
52 | ativar-comando: true
53 | aliases: [workbench]
54 | descricao: "Abre uma bancada de trabalho virtual."
55 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
56 |
57 | crashar:
58 | ativar-comando: true
59 | aliases: [derrubar]
60 | descricao: "Crasha o minecraft de um player."
61 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
62 |
63 | criarkit:
64 | ativar-comando: true
65 | aliases: [createkit]
66 | descricao: "Cria um kit."
67 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
68 |
69 | darkit:
70 | ativar-comando: true
71 | aliases: [givekit]
72 | descricao: "Envia um kit para um player."
73 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
74 |
75 | delhome:
76 | ativar-comando: true
77 | aliases: []
78 | descricao: "Deleta uma home."
79 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
80 |
81 | delkit:
82 | ativar-comando: true
83 | aliases: [apagarkit]
84 | descricao: "Deleta um kit."
85 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
86 |
87 | delwarp:
88 | ativar-comando: true
89 | aliases: []
90 | descricao: "Deleta uma warp."
91 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
92 |
93 | derreter:
94 | ativar-comando: true
95 | aliases: [aquecer]
96 | descricao: "Derrete todos os minérios do inventario."
97 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
98 |
99 | divulgar:
100 | ativar-comando: true
101 | aliases: []
102 | descricao: "Divulga um link no chat."
103 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
104 |
105 | echest:
106 | ativar-comando: true
107 | aliases: [ec, enderchest]
108 | descricao: "Abre o enderchest virtual."
109 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
110 |
111 | editaritem:
112 | ativar-comando: true
113 | aliases: [renomear, lore]
114 | descricao: "Edita o item que esta na mão."
115 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
116 |
117 | editarkit:
118 | ativar-comando: true
119 | aliases: [editkit]
120 | descricao: "Edita um kit criado."
121 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
122 |
123 | editarplaca:
124 | ativar-comando: true
125 | aliases: [signedit]
126 | descricao: "Edita uma placa sem precisar quebra-la."
127 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
128 |
129 | enchant:
130 | ativar-comando: true
131 | aliases: [encantar]
132 | descricao: "Encanta um item de maneira fácil."
133 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
134 |
135 | estatisticas:
136 | ativar-comando: true
137 | aliases: []
138 | descricao: "Mostra as estatisticas de um player."
139 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
140 |
141 | executarsom:
142 | ativar-comando: true
143 | aliases: [playsound, som]
144 | descricao: "Executa um som para um player ou para todo server."
145 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
146 |
147 | feed:
148 | ativar-comando: true
149 | aliases: [fome, comer]
150 | descricao: "Regenera toda sua fome."
151 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
152 |
153 | fly:
154 | ativar-comando: true
155 | aliases: [voar]
156 | descricao: "Ativa ou desativa o modo fly."
157 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
158 |
159 | gamemode:
160 | ativar-comando: true
161 | aliases: [gm]
162 | descricao: "Altera o seu modo de jogo."
163 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
164 |
165 | god:
166 | ativar-comando: true
167 | aliases: [deus]
168 | descricao: "Ativa ou desativa o modo imortal."
169 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
170 |
171 | heal:
172 | ativar-comando: true
173 | aliases: [curar, health]
174 | descricao: "Regenera toda sua vida."
175 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
176 |
177 | home:
178 | ativar-comando: true
179 | aliases: []
180 | descricao: "Teleporta até uma home."
181 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
182 |
183 | homes:
184 | ativar-comando: true
185 | aliases: []
186 | descricao: "Mostra a lista de homes salvas."
187 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
188 |
189 | invsee:
190 | ativar-comando: true
191 | aliases: [inv]
192 | descricao: "Abre o inventario de um player."
193 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
194 |
195 | kit:
196 | ativar-comando: true
197 | aliases: []
198 | descricao: "Pega um kit."
199 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
200 |
201 | kits:
202 | ativar-comando: true
203 | aliases: []
204 | descricao: "Lista todos os kits disponíveis."
205 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
206 |
207 | lixo:
208 | ativar-comando: true
209 | aliases: [lixeira]
210 | descricao: "Abre a lixeira virtual."
211 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
212 |
213 | luz:
214 | ativar-comando: true
215 | aliases: [lanterna]
216 | descricao: "Liga e desliga a lanterna."
217 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
218 |
219 | mundovip:
220 | ativar-comando: true
221 | aliases: [vip]
222 | descricao: "Teleporta até o mundo vip."
223 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
224 |
225 | online:
226 | ativar-comando: true
227 | aliases: []
228 | descricao: "Mostra a numero de players online no servidor."
229 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
230 |
231 | particular:
232 | ativar-comando: true
233 | aliases: [privar]
234 | descricao: "Define uma home como particular."
235 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
236 |
237 | ping:
238 | ativar-comando: true
239 | aliases: []
240 | descricao: "Mostra o seu ping atual."
241 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
242 |
243 | potion:
244 | ativar-comando: true
245 | aliases: [pocao]
246 | descricao: "Edita uma poção."
247 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
248 |
249 | publica:
250 | ativar-comando: true
251 | aliases: []
252 | descricao: "Define uma home como publica."
253 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
254 |
255 | renderizacao:
256 | ativar-comando: true
257 | aliases: [render]
258 | descricao: "Altera sua renderização no servidor."
259 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
260 |
261 | reparar:
262 | ativar-comando: true
263 | aliases: [repair]
264 | descricao: "Reparar os seus itens."
265 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
266 |
267 | sethome:
268 | ativar-comando: true
269 | aliases: []
270 | descricao: "Define uma home."
271 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
272 |
273 | setmundovip:
274 | ativar-comando: true
275 | aliases: []
276 | descricao: "Define a mundo vip e não vip do servidor."
277 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
278 |
279 | setspawn:
280 | ativar-comando: true
281 | aliases: []
282 | descricao: "Define o spawn do servidor."
283 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
284 |
285 | setwarp:
286 | ativar-comando: true
287 | aliases: []
288 | descricao: "Define uma warp."
289 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
290 |
291 | sgive:
292 | ativar-comando: true
293 | aliases: [spawnergive, spawner]
294 | descricao: "Envia geradores para um player."
295 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
296 |
297 | skull:
298 | ativar-comando: true
299 | aliases: [head, cabeca]
300 | descricao: "Pega a cabeça de um player."
301 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
302 |
303 | slime:
304 | ativar-comando: true
305 | aliases: [slimechunk]
306 | descricao: "Verifica se você esta em uma slimechunk."
307 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
308 |
309 | spawn:
310 | ativar-comando: true
311 | aliases: []
312 | descricao: "Teleporta até o spawn."
313 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
314 |
315 | speed:
316 | ativar-comando: true
317 | aliases: [velocidade]
318 | descricao: "Altera a velocidade do andar e do voar."
319 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
320 |
321 | sudo:
322 | ativar-comando: true
323 | aliases: []
324 | descricao: "Executa um comando para um player."
325 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
326 |
327 | system:
328 | ativar-comando: true
329 | aliases: [rushyoutuber]
330 | descricao: "Comando gerenciador do plugin."
331 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
332 |
333 | title:
334 | ativar-comando: true
335 | aliases: [tm]
336 | descricao: "Envia um title para todo servidor."
337 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
338 |
339 | tp:
340 | ativar-comando: true
341 | aliases: []
342 | descricao: "Executa teleportes."
343 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
344 |
345 | tpa:
346 | ativar-comando: true
347 | aliases: []
348 | descricao: "Envia uma solicitação de teleporte."
349 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
350 |
351 | tpaccept:
352 | ativar-comando: true
353 | aliases: [tpaceitar]
354 | descricao: "Aceita uma solicitação de teleporte."
355 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
356 |
357 | tpall:
358 | ativar-comando: true
359 | aliases: []
360 | descricao: "Teleporta todos os players."
361 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
362 |
363 | tpcancel:
364 | ativar-comando: true
365 | aliases: [tpcancelar]
366 | descricao: "Cancela uma solicitação de teleporte enviada."
367 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
368 |
369 | tpdeny:
370 | ativar-comando: true
371 | aliases: [tpnegar]
372 | descricao: "Rejeita uma solicitação de teleporte."
373 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
374 |
375 | tphere:
376 | ativar-comando: true
377 | aliases: [puxar]
378 | descricao: "Teleporta um player até você."
379 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
380 |
381 | tptoggle:
382 | ativar-comando: true
383 | aliases: [tpdesativar]
384 | descricao: "Desativa o recebimento de solicitações de teleporte."
385 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
386 |
387 | vanish:
388 | ativar-comando: true
389 | aliases: [v]
390 | descricao: "Ativa ou desativa o modo invisível."
391 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
392 |
393 | verkit:
394 | ativar-comando: true
395 | aliases: [visualizarkit]
396 | descricao: "Visualiza os itens de um kit."
397 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
398 |
399 | verinfo:
400 | ativar-comando: true
401 | aliases: [playerinfo, whois]
402 | descricao: "Visualiza as informações de um player."
403 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
404 |
405 | warp:
406 | ativar-comando: true
407 | aliases: []
408 | descricao: "Teleporta até uma warp."
409 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
410 |
411 | warps:
412 | ativar-comando: true
413 | aliases: []
414 | descricao: "Lista todas as warps disponíveis."
415 | sem-permissao: "&cVocê não tem permissão para utilizar este comando."
--------------------------------------------------------------------------------