Class ReflectionManager
java.lang.Object
me.libraryaddict.disguise.utilities.reflection.ReflectionManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEntityToTrackedMap(Object entityTracker, Object entityTrackerEntry, org.bukkit.entity.Player player) static voidaddEntityTracker(Object entityTracker, Object trackerEntry, Object player) static voidclearEntityTracker(Object entityTracker, Object trackerEntry, Object player) static <T> TconvertMetaFromSerialized(MetaIndex<T> index, Object value) static ObjectconvertMetaToSerialized(com.github.retrooper.packetevents.util.mappings.IRegistryHolder registryHolder, MetaIndex index, Object value) static ObjectconvertMetaToSerialized(MetaIndex index, Object value) static com.mojang.authlib.GameProfileconvertProfile(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile) static ObjectcreateMinecraftKey(String name) static org.bukkit.profile.PlayerProfilecreateProfile(com.github.retrooper.packetevents.protocol.player.UserProfile profile) static Stringstatic intenumOrdinal(Object obj) static <T> T[]enumValues(Class<T> clss) static <T> Tstatic <T> Tstatic org.bukkit.block.data.BlockDatagetBlockDataByCombinedId(int id) static me.libraryaddict.disguise.utilities.reflection.FakeBoundingBoxgetBoundingBox(org.bukkit.entity.Entity entity) static org.bukkit.entity.EntitygetBukkitEntity(Object nmsEntity) static org.bukkit.inventory.ItemStackgetBukkitItem(Object nmsItem) static org.bukkit.SoundCategorygetBukkitSoundCategory(DisguiseType disguiseType) static com.github.retrooper.packetevents.protocol.player.UserProfilegetClonedProfile(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile) static SetgetClonedTrackedPlayers(Object entityTracker, Object entityTrackerEntry) static intgetCombinedIdByBlockData(org.bukkit.block.data.BlockData data) static intgetCombinedIdByItemStack(org.bukkit.inventory.ItemStack itemStack) static intgetCombinedIdByWrappedBlockState(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState state) static org.bukkit.command.SimpleCommandMapgetCommands(org.bukkit.command.CommandMap map) static Stringstatic Class<?> getCraftClass(String className) static ConstructorgetCraftConstructor(Class clazz, Class<?>... parameters) static ConstructorgetCraftConstructor(String className, Class<?>... parameters) static org.bukkit.inventory.ItemStackgetCraftItem(org.bukkit.inventory.ItemStack bukkitItem) static MethodgetCraftMethod(Class<?> clazz, String methodName, Class<?>... parameters) static MethodgetCraftMethod(String className, String methodName, Class<?>... parameters) static org.bukkit.inventory.meta.ItemMetagetDeserializedItemMeta(Map<String, Object> meta) static com.github.retrooper.packetevents.protocol.entity.data.EntityDatagetEntityData(MetaIndex index, Object obj, boolean bukkitReadable) static com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypegetEntityDataType(MetaIndex index, Field field) static ObjectgetEntityTracker(org.bukkit.entity.Entity target) static ObjectgetEntityTrackerEntry(org.bukkit.entity.Entity target) Deprecated.static ObjectgetEntityTrackerEntry(org.bukkit.entity.Entity target, Object entityTracker) static ObjectgetEntityType(org.bukkit.entity.EntityType entityType) static ObjectgetEntityType(org.bukkit.NamespacedKey name) static intgetEntityTypeId(Object entityTypes) static intgetEntityTypeId(org.bukkit.entity.EntityType entityType) static List<com.github.retrooper.packetevents.protocol.entity.data.EntityData<?>> getEntityWatcher(org.bukkit.entity.Entity entity) getFilesByPlugin(File containingFolder, String pluginName) Deprecated.getFilesByPlugin(String pluginName) Deprecated.static longgetGameTime(org.bukkit.entity.Entity entity) static intgetIncrementedStateId(org.bukkit.entity.Player player) static StringgetItemName(org.bukkit.Material material) static org.bukkit.inventory.ItemStackgetItemStackByCombinedId(int id) static intgetJarFileCount(File file) Deprecated.static org.bukkit.MaterialgetMaterial(String name) static com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadatagetMetadataPacket(int entityId, List<me.libraryaddict.disguise.utilities.reflection.WatcherValue> values) static Objectstatic Stringstatic intstatic intgetNewEntityId(boolean increment) static ClassgetNmsClass(String className) static ClassgetNmsClassIgnoreErrors(String className) static ClassgetNmsClassIgnoreErrors(String className, boolean can404) static ConstructorgetNmsConstructor(Class clazz, Class<?>... parameters) static ConstructorgetNmsConstructor(String className, Class<?>... parameters) static ObjectgetNmsEntity(org.bukkit.entity.Entity entity) static FieldgetNmsField(Class clazz, String fieldName) static FieldgetNmsField(String className, String fieldName) static MethodgetNmsMethod(Class<?> clazz, String methodName, Class<?>... parameters) static MethodgetNmsMethod(String className, String methodName, Class<?>... parameters) static StringDeprecated.static doublegetPing(org.bukkit.entity.Player player) static ObjectgetPlayerConnectionOrPlayer(org.bukkit.entity.Player player) static ObjectgetPlayerFromPlayerConnection(Object nmsEntity) static org.bukkit.configuration.file.YamlConfigurationgetPluginYAML(File file) Deprecated.static org.bukkit.configuration.file.YamlConfigurationgetPluginYAMLEx(File file) Deprecated.static UUIDUsed for generating a UUID with a custom version instead of the default 4.static me.libraryaddict.disguise.utilities.reflection.ReflectionManagerAbstractgetReflectionManager(NmsVersion nmsVersion) static StringgetResourceAsString(File file, String fileName) Deprecated.static StringgetResourceAsStringEx(File file, String fileName) Deprecated.static float[]getSize(org.bukkit.entity.Entity entity) static com.github.retrooper.packetevents.protocol.player.UserProfilegetSkullBlob(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile) static com.github.retrooper.packetevents.protocol.sound.SoundCategorygetSoundCategory(DisguiseType disguiseType) static FloatgetSoundModifier(Object entity) static ClassgetSuperClass(Class cl) static SetgetTrackedPlayers(Object entityTracker, Object entityTrackerEntry) static com.github.retrooper.packetevents.protocol.player.UserProfilegetUserProfile(com.mojang.authlib.GameProfile gameProfile) static com.github.retrooper.packetevents.protocol.player.UserProfilegetUserProfile(UUID uuid, String playerName) static com.github.retrooper.packetevents.protocol.player.UserProfilegetUserProfile(org.bukkit.entity.Player player) static com.github.retrooper.packetevents.protocol.player.UserProfilegetUserProfileWithThisSkin(UUID uuid, String playerName, com.github.retrooper.packetevents.protocol.player.UserProfile profileWithSkin) static NmsVersionstatic ObjectgetWorldServer(org.bukkit.World w) static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockStategetWrappedBlockStateByCombinedId(int combinedId) static com.github.retrooper.packetevents.protocol.player.UserProfilegrabProfileAddUUID(String playername) Gets the UUID of the player, as well as properly capitalized playernamestatic booleanhasInvul(org.bukkit.entity.Entity entity) static voidinit()static booleanisAssignableFrom(Class baseAbstractClass, Class extendingClass) static booleanisCraftItem(org.bukkit.inventory.ItemStack bukkitItem) static booleanstatic booleanisSupported(Class cl, String name) static booleanstatic Stringstatic <T> TrandomEnum(Class<T> clss) static <T extends com.github.retrooper.packetevents.protocol.mapper.MappedEntity>
TrandomRegistry(com.github.retrooper.packetevents.util.mappings.VersionedRegistry<@NotNull T> registry) static byte[]readFuzzyFully(InputStream input) static ObjectregisterEntityType(org.bukkit.NamespacedKey key) static voidHere we create a nms entity for each disguise.static voidremoveEntityFromTracked(Object entityTracker, Object entityTrackerEntry, org.bukkit.entity.Player player) static voidsetBoundingBox(org.bukkit.entity.Entity entity, me.libraryaddict.disguise.utilities.reflection.FakeBoundingBox newBox, double scale) static voidstatic StringtoReadable(String string) static StringtoReadable(String string, String joiner) static voidNot really the optimal solution, but the alternative is that we cannot resolve any of this until a player joins
-
Constructor Details
-
ReflectionManager
public ReflectionManager()
-
-
Method Details
-
isRunningPaper
public static boolean isRunningPaper() -
init
public static void init() -
tryLoadRegistriesIntoPE
public static void tryLoadRegistriesIntoPE()Not really the optimal solution, but the alternative is that we cannot resolve any of this until a player joins -
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
-
isSupported
-
getResourceAsString
Deprecated. -
getJarFileCount
Deprecated.- Throws:
IOException
-
getResourceAsStringEx
Deprecated. -
getFilesByPlugin
Deprecated. -
getFilesByPlugin
Deprecated. -
getPluginYAML
Deprecated.Copied from Bukkit -
getPluginYAMLEx
@Deprecated public static org.bukkit.configuration.file.YamlConfiguration getPluginYAMLEx(File file) throws Exception Deprecated.- 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
-
getBoundingBox
public static me.libraryaddict.disguise.utilities.reflection.FakeBoundingBox getBoundingBox(org.bukkit.entity.Entity entity) -
getPlayerFromPlayerConnection
-
getBukkitEntity
-
getBukkitItem
-
isCraftItem
public static boolean isCraftItem(org.bukkit.inventory.ItemStack bukkitItem) -
getCraftItem
public static org.bukkit.inventory.ItemStack getCraftItem(org.bukkit.inventory.ItemStack bukkitItem) -
getVersion
-
getMinecraftVersion
-
getNmsPackage
Deprecated. -
getCraftBukkitPackage
-
getCraftClass
-
getReflectionManager
public static me.libraryaddict.disguise.utilities.reflection.ReflectionManagerAbstract getReflectionManager(NmsVersion nmsVersion) -
getCraftConstructor
-
getCraftConstructor
-
getEntityTracker
- Throws:
Exception
-
getEntityTrackerEntry
public static Object getEntityTrackerEntry(org.bukkit.entity.Entity target, Object entityTracker) throws Exception - Throws:
Exception
-
getEntityTrackerEntry
@Deprecated public static Object getEntityTrackerEntry(org.bukkit.entity.Entity target) throws Exception Deprecated.Deprecated as its more efficient to call getEntityTrackerEntry(entity, object)- Throws:
Exception
-
getMinecraftServer
-
convertProfile
public static com.mojang.authlib.GameProfile convertProfile(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile) -
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 gameProfile) -
getUserProfile
-
getClonedProfile
public static com.github.retrooper.packetevents.protocol.player.UserProfile getClonedProfile(com.github.retrooper.packetevents.protocol.player.UserProfile userProfile) -
getUserProfileWithThisSkin
-
getRandomUUID
Used for generating a UUID with a custom version instead of the default 4. Workaround for China's NetEase servers -
getNmsClass
-
getNmsClassIgnoreErrors
-
getNmsClassIgnoreErrors
-
getNmsConstructor
-
getNmsConstructor
-
getNmsEntity
-
getNmsField
-
getNmsField
-
getClonedTrackedPlayers
-
getTrackedPlayers
-
clearEntityTracker
-
addEntityTracker
-
addEntityToTrackedMap
-
removeEntityFromTracked
-
getCraftMethod
-
getCraftMethod
-
getNmsMethod
-
getNmsMethod
-
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
-
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) -
getBukkitSoundCategory
-
getSoundCategory
public static com.github.retrooper.packetevents.protocol.sound.SoundCategory getSoundCategory(DisguiseType disguiseType) -
convertMetaFromSerialized
-
convertMetaToSerialized
-
convertMetaToSerialized
-
getMaterial
-
getItemName
-
isAssignableFrom
-
getSuperClass
-
createMinecraftKey
-
getEntityType
-
registerEntityType
-
getEntityTypeId
-
getEntityTypeId
public static int getEntityTypeId(org.bukkit.entity.EntityType entityType) -
getEntityType
-
getEntityData
-
getCombinedIdByBlockData
public static int getCombinedIdByBlockData(org.bukkit.block.data.BlockData data) -
getCombinedIdByWrappedBlockState
public static int getCombinedIdByWrappedBlockState(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState state) -
getWrappedBlockStateByCombinedId
public static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState getWrappedBlockStateByCombinedId(int combinedId) -
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
-
getDeserializedItemMeta
-
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
- Throws:
IOException
-
getEntityWatcher
public static List<com.github.retrooper.packetevents.protocol.entity.data.EntityData<?>> getEntityWatcher(org.bukkit.entity.Entity entity) -
setScore
-
getCommands
-
getCommandMap
public static org.bukkit.command.SimpleCommandMap getCommandMap() -
toReadable
-
toReadable
-
getEntityDataType
-
enumOrdinal
-
enumName
-
keyedName
-
enumValues
-
randomRegistry
public static <T extends com.github.retrooper.packetevents.protocol.mapper.MappedEntity> T randomRegistry(com.github.retrooper.packetevents.util.mappings.VersionedRegistry<@NotNull T> registry) -
randomEnum
-
fromEnum
-
fromEnum
-