Class SpigotReflectionUtil
java.lang.Object
io.github.retrooper.packetevents.util.SpigotReflectionUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Field
static Class
<?> static Class
<?> static Method
static Method
static Class
<?> static Method
static Class
<?> static Field
static Class
<?> static Method
static Class
<?> static Class
<?> static Method
static Method
static Class
<?> static Class
<?> static Class
<?> static Field
static Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Method
static Class
<?> static Field
static Class
<?> static Class
<?> static Field
static Field
static Class
<?> static Class
<?> static Field
static Class
<?> static Class
<?> static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Method
static Class
<?> static Class
<?> static Method
static Class
<?> static Class
<?> static Method
static Field
static final String
static Field
static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Field
static Class
<?> static Class
<?> static Class
<?> static final String
static Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Method
static Class
<?> static Class
<?> static Method
static Method
static Method
static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Class
<?> static Method
static Class
<?> static Method
static boolean
static boolean
static boolean
static com.github.retrooper.packetevents.manager.server.ServerVersion
static Class
<?> static Method
static Method
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
convertBukkitServerToNMSServer
(org.bukkit.Server server) static Object
convertBukkitWorldToWorldServer
(org.bukkit.World world) static Object
convertWorldServerDimensionToNMSNbt
(Object worldServer) static Object
createBlockPosition
(int x, int y, int z) static Object
createNMSItemStack
(int itemID, int count) static Object
createNMSItemStack
(Object nmsItem, int count) static Object
createPacketDataSerializer
(Object byteBuf) static com.github.retrooper.packetevents.protocol.item.ItemStack
decodeBukkitItemStack
(org.bukkit.inventory.ItemStack in) static org.bukkit.inventory.ItemStack
encodeBukkitItemStack
(com.github.retrooper.packetevents.protocol.item.ItemStack in) static com.github.retrooper.packetevents.protocol.nbt.NBTCompound
fromMinecraftNBT
(Object nbtCompound) static Enum
<?> fromPacketEventsParticle
(com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> particle) static String
fromStringToJSON
(String message) static int
static org.bukkit.material.MaterialData
getBlockDataByCombinedId
(int combinedID) static int
getBlockDataCombinedId
(org.bukkit.material.MaterialData materialData) static org.bukkit.entity.Entity
getBukkitEntity
(Object nmsEntity) static Object
getChannel
(org.bukkit.entity.Player player) static Object
getCraftPlayer
(org.bukkit.entity.Player player) static int
getDimensionId
(Object worldServer) static String
getDimensionKey
(Object worldServer) static int
getEffectId
(Object nmsMobEffectList) static @Nullable org.bukkit.entity.Entity
getEntityById
(int entityID) Deprecated.static @Nullable org.bukkit.entity.Entity
getEntityById
(@Nullable org.bukkit.World origin, int id) Deprecated.Please resort toSpigotConversionUtil.getEntityById(World, int)
since the reflection util is not API.static List
<org.bukkit.entity.Entity> getEntityList
(org.bukkit.World world) static Object
getEntityPlayer
(org.bukkit.entity.Player player) static Object
static Object
getGameProfile
(org.bukkit.entity.Player player) static Object
static Object
getMinecraftServerInstance
(org.bukkit.Server server) static Object
getMobEffectListById
(int effectID) static Class
<?> getNettyClass
(String name) static Object
getNetworkManager
(org.bukkit.entity.Player player) static Object
getNMSAxisAlignedBoundingBox
(Object nmsEntity) static Class
<?> getNMSClass
(String name) static Object
getNMSEntity
(org.bukkit.entity.Entity entity) static Object
getNMSItemById
(int id) static int
getNMSItemId
(Object nmsItem) static Class
<?> getOBCClass
(String name) static Object
getPlayerConnection
(org.bukkit.entity.Player player) static int
getPlayerPingLegacy
(org.bukkit.entity.Player player) Deprecated.static @Nullable Class
<?> getServerClass
(String modern, String legacy) static double
getTPS()
static List
<com.github.retrooper.packetevents.protocol.player.TextureProperty> getUserProfile
(org.bukkit.entity.Player player) static void
init()
static boolean
static Object
readNMSItemStackPacketDataSerializer
(Object packetDataSerializer) static Object
static double[]
static org.bukkit.inventory.ItemStack
toBukkitItemStack
(Object nmsItemStack) static Object
toMinecraftNBT
(com.github.retrooper.packetevents.protocol.nbt.NBTCompound nbtCompound) static Object
toNMSItemStack
(org.bukkit.inventory.ItemStack itemStack) static com.github.retrooper.packetevents.protocol.particle.type.ParticleType
<?> toPacketEventsParticle
(Enum<?> particle) static Object
writeNMSItemStackPacketDataSerializer
(Object packetDataSerializer, Object nmsItemStack) static void
writeNmsNbtToStream
(Object compound, DataOutput out)
-
Field Details
-
LEGACY_NMS_PACKAGE
-
OBC_PACKAGE
-
VERSION
public static com.github.retrooper.packetevents.manager.server.ServerVersion VERSION -
V_1_19_OR_HIGHER
public static boolean V_1_19_OR_HIGHER -
V_1_17_OR_HIGHER
public static boolean V_1_17_OR_HIGHER -
V_1_12_OR_HIGHER
public static boolean V_1_12_OR_HIGHER -
MINECRAFT_SERVER_CLASS
-
NMS_PACKET_DATA_SERIALIZER_CLASS
-
NMS_ITEM_STACK_CLASS
-
NMS_IMATERIAL_CLASS
-
NMS_ENTITY_CLASS
-
ENTITY_PLAYER_CLASS
-
BOUNDING_BOX_CLASS
-
NMS_MINECRAFT_KEY_CLASS
-
ENTITY_HUMAN_CLASS
-
PLAYER_CONNECTION_CLASS
-
SERVER_COMMON_PACKETLISTENER_IMPL_CLASS
-
SERVER_CONNECTION_CLASS
-
NETWORK_MANAGER_CLASS
-
NMS_ENUM_PARTICLE_CLASS
-
MOB_EFFECT_LIST_CLASS
-
NMS_ITEM_CLASS
-
DEDICATED_SERVER_CLASS
-
LEVEL_CLASS
-
SERVER_LEVEL_CLASS
-
ENUM_PROTOCOL_DIRECTION_CLASS
-
GAME_PROFILE_CLASS
-
CRAFT_WORLD_CLASS
-
CRAFT_SERVER_CLASS
-
CRAFT_PLAYER_CLASS
-
CRAFT_ENTITY_CLASS
-
CRAFT_ITEM_STACK_CLASS
-
CRAFT_PARTICLE_CLASS
-
LEVEL_ENTITY_GETTER_CLASS
-
PERSISTENT_ENTITY_SECTION_MANAGER_CLASS
-
PAPER_ENTITY_LOOKUP_CLASS
-
CRAFT_MAGIC_NUMBERS_CLASS
-
IBLOCK_DATA_CLASS
-
BLOCK_CLASS
-
CRAFT_BLOCK_DATA_CLASS
-
PROPERTY_MAP_CLASS
-
DIMENSION_MANAGER_CLASS
-
MOJANG_CODEC_CLASS
-
MOJANG_ENCODER_CLASS
-
DATA_RESULT_CLASS
-
DYNAMIC_OPS_NBT_CLASS
-
NMS_NBT_COMPOUND_CLASS
-
NMS_NBT_BASE_CLASS
-
NBT_COMPRESSION_STREAM_TOOLS_CLASS
-
STREAM_CODEC
-
STREAM_DECODER
-
STREAM_ENCODER
-
REGISTRY_FRIENDLY_BYTE_BUF
-
REGISTRY_ACCESS
-
REGISTRY_ACCESS_FROZEN
-
RESOURCE_KEY
-
REGISTRY
-
WRITABLE_REGISTRY
-
NBT_ACCOUNTER
-
CHUNK_PROVIDER_SERVER_CLASS
-
ICHUNKPROVIDER_CLASS
-
CHUNK_STATUS_CLASS
-
BLOCK_POSITION_CLASS
-
PLAYER_CHUNK_MAP_CLASS
-
PLAYER_CHUNK_CLASS
-
CHUNK_CLASS
-
IBLOCKACCESS_CLASS
-
ICHUNKACCESS_CLASS
-
CHANNEL_CLASS
-
BYTE_BUF_CLASS
-
BYTE_TO_MESSAGE_DECODER
-
MESSAGE_TO_BYTE_ENCODER
-
ENTITY_PLAYER_PING_FIELD
-
ENTITY_BOUNDING_BOX_FIELD
-
BYTE_BUF_IN_PACKET_DATA_SERIALIZER
-
DIMENSION_CODEC_FIELD
-
DYNAMIC_OPS_NBT_INSTANCE_FIELD
-
CHUNK_PROVIDER_SERVER_FIELD
-
CRAFT_PARTICLE_PARTICLES_FIELD
-
NMS_MK_KEY_FIELD
-
LEGACY_NMS_PARTICLE_KEY_FIELD
-
LEGACY_NMS_KEY_TO_NMS_PARTICLE
-
IS_DEBUGGING
-
GET_CRAFT_PLAYER_HANDLE_METHOD
-
GET_CRAFT_ENTITY_HANDLE_METHOD
-
GET_CRAFT_WORLD_HANDLE_METHOD
-
GET_MOB_EFFECT_LIST_ID_METHOD
-
GET_MOB_EFFECT_LIST_BY_ID_METHOD
-
GET_ITEM_ID_METHOD
-
GET_ITEM_BY_ID_METHOD
-
GET_BUKKIT_ENTITY_METHOD
-
GET_LEVEL_ENTITY_GETTER_ITERABLE_METHOD
-
GET_ENTITY_BY_ID_LEVEL_ENTITY_GETTER_METHOD
-
GET_ENTITY_BY_ID_METHOD
-
CRAFT_ITEM_STACK_AS_BUKKIT_COPY
-
CRAFT_ITEM_STACK_AS_NMS_COPY
-
BUKKIT_PARTICLE_TO_NMS_ENUM_PARTICLE
-
NMS_ENUM_PARTICLE_TO_BUKKIT_PARTICLE
-
READ_ITEM_STACK_IN_PACKET_DATA_SERIALIZER_METHOD
-
WRITE_ITEM_STACK_IN_PACKET_DATA_SERIALIZER_METHOD
-
GET_COMBINED_ID
-
GET_BY_COMBINED_ID
-
GET_CRAFT_BLOCK_DATA_FROM_IBLOCKDATA
-
PROPERTY_MAP_GET_METHOD
-
GET_DIMENSION_MANAGER
-
GET_DIMENSION_ID
-
GET_DIMENSION_KEY
-
CODEC_ENCODE_METHOD
-
DATA_RESULT_GET_METHOD
-
READ_NBT_FROM_STREAM_METHOD
-
WRITE_NBT_TO_STREAM_METHOD
-
STREAM_DECODER_DECODE
-
STREAM_ENCODER_ENCODE
-
CREATE_REGISTRY_RESOURCE_KEY
-
GET_REGISTRY_OR_THROW
-
GET_DIMENSION_TYPES
-
GET_REGISTRY_ID
-
NBT_ACCOUNTER_UNLIMITED_HEAP
-
GET_REGISTRY_KEY_LOCATION
-
CHUNK_CACHE_GET_IBLOCKACCESS
-
CHUNK_CACHE_GET_ICHUNKACCESS
-
IBLOCKACCESS_GET_BLOCK_DATA
-
CHUNK_GET_BLOCK_DATA
-
PLAYER_CHUNK_MAP_GET_PLAYER_CHUNK
-
PLAYER_CHUNK_GET_CHUNK
-
ENTITY_ID_CACHE
-
-
Constructor Details
-
SpigotReflectionUtil
public SpigotReflectionUtil()
-
-
Method Details
-
init
public static void init() -
getServerClass
-
isMinecraftServerInstanceDebugging
public static boolean isMinecraftServerInstanceDebugging() -
getMinecraftServerInstance
-
getMinecraftServerConnectionInstance
-
getTPS
public static double getTPS() -
recentTPS
public static double[] recentTPS() -
getNMSClass
- Throws:
ClassNotFoundException
-
getOBCClass
-
getNettyClass
-
getBukkitEntity
-
getNMSEntity
-
getNMSAxisAlignedBoundingBox
-
getCraftPlayer
-
getEntityPlayer
-
getPlayerConnection
-
getGameProfile
-
getUserProfile
public static List<com.github.retrooper.packetevents.protocol.player.TextureProperty> getUserProfile(org.bukkit.entity.Player player) -
getNetworkManager
-
getChannel
-
getPlayerPingLegacy
Deprecated. -
getNetworkManagers
-
convertBukkitServerToNMSServer
-
convertBukkitWorldToWorldServer
-
convertWorldServerDimensionToNMSNbt
-
getDimensionId
-
getDimensionKey
-
fromStringToJSON
-
generateEntityId
public static int generateEntityId() -
getEffectId
-
getMobEffectListById
-
getNMSItemId
-
getNMSItemById
-
createNMSItemStack
-
decodeBukkitItemStack
public static com.github.retrooper.packetevents.protocol.item.ItemStack decodeBukkitItemStack(org.bukkit.inventory.ItemStack in) -
encodeBukkitItemStack
public static org.bukkit.inventory.ItemStack encodeBukkitItemStack(com.github.retrooper.packetevents.protocol.item.ItemStack in) -
getBlockDataCombinedId
public static int getBlockDataCombinedId(org.bukkit.material.MaterialData materialData) -
getBlockDataByCombinedId
public static org.bukkit.material.MaterialData getBlockDataByCombinedId(int combinedID) -
createNMSItemStack
-
createPacketDataSerializer
-
createBlockPosition
-
getFrozenRegistryAccess
-
toBukkitItemStack
-
toNMSItemStack
-
readNMSItemStackPacketDataSerializer
-
writeNMSItemStackPacketDataSerializer
-
fromMinecraftNBT
public static com.github.retrooper.packetevents.protocol.nbt.NBTCompound fromMinecraftNBT(Object nbtCompound) -
toMinecraftNBT
public static Object toMinecraftNBT(com.github.retrooper.packetevents.protocol.nbt.NBTCompound nbtCompound) -
writeNmsNbtToStream
-
readNmsNbtFromStream
-
getEntityById
@Deprecated @Nullable public static @Nullable org.bukkit.entity.Entity getEntityById(@Nullable @Nullable org.bukkit.World origin, int id) Deprecated.Please resort toSpigotConversionUtil.getEntityById(World, int)
since the reflection util is not API.Get the entity by the id. -
getEntityById
Deprecated.Please resort toSpigotConversionUtil.getEntityById(World, int)
since the reflection util is not API.Get the entity by the id. -
getEntityList
-
toPacketEventsParticle
public static com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> toPacketEventsParticle(Enum<?> particle) -
fromPacketEventsParticle
public static Enum<?> fromPacketEventsParticle(com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> particle)
-
SpigotConversionUtil.getEntityById(World, int)
since the reflection util is not API.