public class PacketRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
static ReportType |
REPORT_CANNOT_CORRECT_TROVE_MAP |
static ReportType |
REPORT_INSUFFICIENT_CLIENT_PACKETS |
static ReportType |
REPORT_INSUFFICIENT_SERVER_PACKETS |
| Constructor and Description |
|---|
PacketRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static Set<Integer> |
getClientPackets()
Deprecated.
|
static Set<PacketType> |
getClientPacketTypes()
Retrieve every known and supported server packet type.
|
static Map<Integer,Class> |
getOverwrittenPackets()
Deprecated.
|
static Class |
getPacketClassFromID(int packetID)
Deprecated.
|
static Class |
getPacketClassFromID(int packetID,
boolean forceVanilla)
Deprecated.
|
static Class |
getPacketClassFromType(PacketType type)
Retrieves the correct packet class from a given type.
|
static Class |
getPacketClassFromType(PacketType type,
boolean forceVanilla)
Retrieves the correct packet class from a given type.
|
static int |
getPacketID(Class<?> packet)
Deprecated.
|
static Map<Class,Integer> |
getPacketToID()
Deprecated.
|
static Map<Class,PacketType> |
getPacketToType()
Retrieve a map of every packet class to the respective packet type.
|
static PacketType |
getPacketType(Class<?> packet)
Retrieve the packet type of a given packet.
|
static PacketType |
getPacketType(Class<?> packet,
PacketType.Sender sender)
Retrieve the packet type of a given packet.
|
static Map<Integer,Class> |
getPreviousPackets()
Deprecated.
|
static Set<Integer> |
getServerPackets()
Deprecated.
|
static Set<PacketType> |
getServerPacketTypes()
Retrieve every known and supported server packet type.
|
static boolean |
isSupported(PacketType type)
Determine if the given packet type is supported on the current server.
|
static Set<Integer> |
toLegacy(Set<PacketType> types)
Convert a set of packet types to a set of integers based on the legacy packet ID.
|
static Set<PacketType> |
toPacketTypes(Set<Integer> ids)
Convert a set of legacy packet IDs to packet types.
|
static Set<PacketType> |
toPacketTypes(Set<Integer> ids,
PacketType.Sender preference)
Convert a set of legacy packet IDs to packet types.
|
public static final ReportType REPORT_CANNOT_CORRECT_TROVE_MAP
public static final ReportType REPORT_INSUFFICIENT_SERVER_PACKETS
public static final ReportType REPORT_INSUFFICIENT_CLIENT_PACKETS
public static boolean isSupported(PacketType type)
type - - the type to check.@Deprecated public static Map<Class,Integer> getPacketToID()
Deprecated: Use getPacketToType() instead.
public static Map<Class,PacketType> getPacketToType()
@Deprecated public static Map<Integer,Class> getOverwrittenPackets()
This is not supported in 1.7.2 and later.
@Deprecated public static Map<Integer,Class> getPreviousPackets()
@Deprecated public static Set<Integer> getServerPackets() throws FieldAccessException
Deprecated: Use getServerPacketTypes() instead.
FieldAccessException - If we're unable to retrieve the server packet data from Minecraft.public static Set<PacketType> getServerPacketTypes()
@Deprecated public static Set<Integer> getClientPackets() throws FieldAccessException
Deprecated: Use getClientPacketTypes() instead.
FieldAccessException - If we're unable to retrieve the client packet data from Minecraft.public static Set<PacketType> getClientPacketTypes()
public static Set<Integer> toLegacy(Set<PacketType> types)
types - - packet type.public static Set<PacketType> toPacketTypes(Set<Integer> ids)
ids - - legacy packet IDs.public static Set<PacketType> toPacketTypes(Set<Integer> ids, PacketType.Sender preference)
ids - - legacy packet IDs.preference - - the sender preference, if any.@Deprecated public static Class getPacketClassFromID(int packetID)
Deprecated: Use getPacketClassFromType(PacketType) instead.
packetID - - the packet ID.public static Class getPacketClassFromType(PacketType type)
type - - the packet type.public static Class getPacketClassFromType(PacketType type, boolean forceVanilla)
Note that forceVanillla will be ignored on MC 1.7.2 and later.
type - - the packet type.forceVanilla - - whether or not to look for vanilla classes, not injected classes.@Deprecated public static Class getPacketClassFromID(int packetID, boolean forceVanilla)
This method has been deprecated.
packetID - - the packet ID.forceVanilla - - whether or not to look for vanilla classes, not injected classes.@Deprecated public static int getPacketID(Class<?> packet)
Deprecated: Use getPacketType(Class).
packet - - the type of packet to check.IllegalArgumentException - If this is not a valid packet.public static PacketType getPacketType(Class<?> packet)
packet - - the class of the packet.public static PacketType getPacketType(Class<?> packet, PacketType.Sender sender)
packet - - the class of the packet.sender - - the sender of the packet, or NULL.Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.