Class ReflectionManager

java.lang.Object
me.libraryaddict.disguise.utilities.reflection.ReflectionManager

public class ReflectionManager extends Object
  • Constructor Details

    • ReflectionManager

      public ReflectionManager()
  • Method Details

    • init

      public static void init()
    • getGameTime

      public static long getGameTime(org.bukkit.entity.Entity entity)
    • hasInvul

      public static boolean hasInvul(org.bukkit.entity.Entity entity)
    • getIncrementedStateId

      public static int getIncrementedStateId(org.bukkit.entity.Player player)
    • isSupported

      public static boolean isSupported(AccessibleObject obj)
    • isSupported

      public static boolean isSupported(Class cl, String name)
    • getResourceAsString

      public static String getResourceAsString(File file, String fileName)
    • getJarFileCount

      public static int getJarFileCount(File file) throws IOException
      Throws:
      IOException
    • getResourceAsStringEx

      public static String getResourceAsStringEx(File file, String fileName)
    • getFilesByPlugin

      public static List<File> getFilesByPlugin(String pluginName)
    • getPluginYAML

      public static org.bukkit.configuration.file.YamlConfiguration getPluginYAML(File file)
      Copied from Bukkit
    • getPluginYAMLEx

      public static org.bukkit.configuration.file.YamlConfiguration getPluginYAMLEx(File file) throws Exception
      Throws:
      Exception
    • getNewEntityId

      public static int getNewEntityId()
    • getNewEntityId

      public static int getNewEntityId(boolean increment)
    • getMetadataPacket

      public static com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata getMetadataPacket(int entityId, List<me.libraryaddict.disguise.utilities.reflection.WatcherValue> values)
    • getPlayerConnectionOrPlayer

      public static Object getPlayerConnectionOrPlayer(org.bukkit.entity.Player player)
    • createEntityInstance

      public static Object createEntityInstance(DisguiseType disguiseType, String entityName)
    • getBoundingBox

      public static me.libraryaddict.disguise.utilities.reflection.FakeBoundingBox getBoundingBox(org.bukkit.entity.Entity entity)
    • getPlayerFromPlayerConnection

      public static Object getPlayerFromPlayerConnection(Object nmsEntity)
    • getBukkitEntity

      public static org.bukkit.entity.Entity getBukkitEntity(Object nmsEntity)
    • getBukkitItem

      public static org.bukkit.inventory.ItemStack getBukkitItem(Object nmsItem)
    • isCraftItem

      public static boolean isCraftItem(org.bukkit.inventory.ItemStack bukkitItem)
    • getCraftItem

      public static org.bukkit.inventory.ItemStack getCraftItem(org.bukkit.inventory.ItemStack bukkitItem)
    • getVersion

      public static NmsVersion getVersion()
    • getMinecraftVersion

      public static String getMinecraftVersion()
    • getNmsPackage

      @Deprecated public static String getNmsPackage()
      Deprecated.
    • getCraftBukkitPackage

      public static String getCraftBukkitPackage()
    • getCraftClass

      public static Class<?> getCraftClass(String className)
    • getReflectionManager

      public static me.libraryaddict.disguise.utilities.reflection.ReflectionManagerAbstract getReflectionManager(NmsVersion nmsVersion)
    • getCraftConstructor

      public static Constructor getCraftConstructor(Class clazz, Class<?>... parameters)
    • getCraftConstructor

      public static Constructor getCraftConstructor(String className, Class<?>... parameters)
    • getEntityTracker

      public static Object getEntityTracker(org.bukkit.entity.Entity target) throws Exception
      Throws:
      Exception
    • getEntityTrackerEntry

      public static Object getEntityTrackerEntry(org.bukkit.entity.Entity target) throws Exception
      Throws:
      Exception
    • getMinecraftServer

      public static Object getMinecraftServer()
    • convertProfile

      public static com.mojang.authlib.GameProfile convertProfile(com.github.retrooper.packetevents.protocol.player.UserProfile profile)
    • createProfile

      public static org.bukkit.profile.PlayerProfile createProfile(com.github.retrooper.packetevents.protocol.player.UserProfile profile)
    • getUserProfile

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getUserProfile(org.bukkit.entity.Player player)
    • getUserProfile

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getUserProfile(com.mojang.authlib.GameProfile userProfile)
    • getUserProfile

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getUserProfile(UUID uuid, String playerName)
    • getClonedProfile

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getClonedProfile(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile)
    • getUserProfileWithThisSkin

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getUserProfileWithThisSkin(UUID uuid, String playerName, com.github.retrooper.packetevents.protocol.player.UserProfile profileWithSkin)
    • getRandomUUID

      public static UUID getRandomUUID()
      Used for generating a UUID with a custom version instead of the default 4. Workaround for China's NetEase servers
    • getNmsClass

      public static Class getNmsClass(String className)
    • getNmsClassIgnoreErrors

      public static Class getNmsClassIgnoreErrors(String className)
    • getNmsConstructor

      public static Constructor getNmsConstructor(Class clazz, Class<?>... parameters)
    • getNmsConstructor

      public static Constructor getNmsConstructor(String className, Class<?>... parameters)
    • getNmsEntity

      public static Object getNmsEntity(org.bukkit.entity.Entity entity)
    • getNmsField

      public static Field getNmsField(Class clazz, String fieldName)
    • getNmsField

      public static Field getNmsField(String className, String fieldName)
    • getClonedTrackedPlayers

      public static Set getClonedTrackedPlayers(Object entityTrackerEntry)
    • getTrackedPlayers

      public static Set getTrackedPlayers(Object entityTrackerEntry)
    • isEntityTrackerMoving

      public static boolean isEntityTrackerMoving(Object entityTrackerEntry)
    • clearEntityTracker

      public static void clearEntityTracker(Object trackerEntry, Object player)
    • addEntityTracker

      public static void addEntityTracker(Object trackerEntry, Object player)
    • addEntityToTrackedMap

      public static void addEntityToTrackedMap(Object tracker, org.bukkit.entity.Player player)
    • removeEntityFromTracked

      public static void removeEntityFromTracked(Object tracker, org.bukkit.entity.Player player)
    • getCraftMethod

      public static Method getCraftMethod(String className, String methodName, Class<?>... parameters)
    • getCraftMethod

      public static Method getCraftMethod(Class<?> clazz, String methodName, Class<?>... parameters)
    • getNmsMethod

      public static Method getNmsMethod(Class<?> clazz, String methodName, Class<?>... parameters)
    • getNmsMethod

      public static Method getNmsMethod(String className, String methodName, Class<?>... parameters)
    • getPing

      public static double getPing(org.bukkit.entity.Player player)
    • getSize

      public static float[] getSize(org.bukkit.entity.Entity entity)
    • getSkullBlob

      public static com.github.retrooper.packetevents.protocol.player.UserProfile getSkullBlob(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile)
    • getSoundModifier

      public static Float getSoundModifier(Object entity)
    • grabProfileAddUUID

      public static com.github.retrooper.packetevents.protocol.player.UserProfile grabProfileAddUUID(String playername)
      Gets the UUID of the player, as well as properly capitalized playername
    • setBoundingBox

      public static void setBoundingBox(org.bukkit.entity.Entity entity, me.libraryaddict.disguise.utilities.reflection.FakeBoundingBox newBox, double scale)
    • getSoundCategory

      public static com.github.retrooper.packetevents.protocol.sound.SoundCategory getSoundCategory(DisguiseType disguiseType)
    • getSoundString

      public static String getSoundString(org.bukkit.Sound sound)
    • convertMetaFromSerialized

      public static <T> T convertMetaFromSerialized(MetaIndex<T> index, Object value)
    • convertMetaToSerialized

      public static Object convertMetaToSerialized(MetaIndex index, Object value)
    • getMaterial

      public static org.bukkit.Material getMaterial(String name)
    • getItemName

      public static String getItemName(org.bukkit.Material material)
    • isAssignableFrom

      public static boolean isAssignableFrom(Class toCheck, Class checkAgainst)
    • getSuperClass

      public static Class getSuperClass(Class cl)
    • createMinecraftKey

      public static Object createMinecraftKey(String name)
    • getEntityType

      public static Object getEntityType(org.bukkit.entity.EntityType entityType)
    • registerEntityType

      public static Object registerEntityType(org.bukkit.NamespacedKey key)
    • getEntityTypeId

      public static int getEntityTypeId(Object entityTypes)
    • getEntityTypeId

      public static int getEntityTypeId(org.bukkit.entity.EntityType entityType)
    • getEntityType

      public static Object getEntityType(org.bukkit.NamespacedKey name)
    • getEntityData

      public static com.github.retrooper.packetevents.protocol.entity.data.EntityData getEntityData(MetaIndex index, Object obj, boolean bukkitReadable)
    • getCombinedIdByBlockData

      public static int getCombinedIdByBlockData(org.bukkit.block.data.BlockData data)
    • getCombinedIdByItemStack

      public static int getCombinedIdByItemStack(org.bukkit.inventory.ItemStack itemStack)
    • getBlockDataByCombinedId

      public static org.bukkit.block.data.BlockData getBlockDataByCombinedId(int id)
    • getItemStackByCombinedId

      public static org.bukkit.inventory.ItemStack getItemStackByCombinedId(int id)
    • getWorldServer

      public static Object getWorldServer(org.bukkit.World w)
    • getDeserializedItemMeta

      public static org.bukkit.inventory.meta.ItemMeta getDeserializedItemMeta(Map<String,Object> meta)
    • registerValues

      public static void registerValues()
      Here we create a nms entity for each disguise. Then grab their default values in their datawatcher. Then their sound volume for mob noises. As well as setting their watcher class and entity size.
    • readFuzzyFully

      public static byte[] readFuzzyFully(InputStream input) throws IOException
      Throws:
      IOException
    • getEntityWatcher

      public static List<com.github.retrooper.packetevents.protocol.entity.data.EntityData> getEntityWatcher(org.bukkit.entity.Entity entity)
    • setScore

      public static void setScore(org.bukkit.scoreboard.Scoreboard scoreboard, String name, int score)
    • setScore

      public static void setScore(org.bukkit.scoreboard.Scoreboard scoreboard, String name, int score, boolean canScheduleTask)
    • getCommands

      public static Map<String,org.bukkit.command.Command> getCommands(org.bukkit.command.CommandMap map)
    • getCommandMap

      public static org.bukkit.command.SimpleCommandMap getCommandMap()
    • toReadable

      public static String toReadable(String string)
    • toReadable

      public static String toReadable(String string, String joiner)
    • getEntityDataType

      public static com.github.retrooper.packetevents.protocol.entity.data.EntityDataType getEntityDataType(MetaIndex index, Field field)
    • enumOrdinal

      public static int enumOrdinal(Object obj)
    • enumName

      public static String enumName(Object obj)
    • keyedName

      public static String keyedName(Object obj)
    • enumValues

      public static <T> T[] enumValues(Class<T> clss)
    • randomEnum

      public static <T> T randomEnum(Class<T> clss)
    • fromEnum

      public static <T> T fromEnum(Class<T> clss, int ordinal)
    • fromEnum

      public static <T> T fromEnum(Class<T> clss, String name)