mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-23 11:05:46 +01:00
Revert protocol-states being used for 1.8 - 1.20.1 packet class to packet type translation (#2961)
This commit is contained in:
parent
b0c4b7fe45
commit
1325ec6a98
@ -712,6 +712,15 @@ public class PacketRegistry {
|
||||
return PacketType.Play.Server.BUNDLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reverts https://github.com/dmulloy2/ProtocolLib/pull/2568 for server versions 1.8 to 1.20.1.
|
||||
*
|
||||
* Since packet classes are not shared for these versions,
|
||||
* the protocol state is not needed to determine the packet type from class.
|
||||
*/
|
||||
if (!MinecraftVersion.CONFIG_PHASE_PROTOCOL_UPDATE.atOrAbove()) {
|
||||
return getPacketType(packet);
|
||||
}
|
||||
Map<Class<?>, PacketType> classToTypesForProtocol = REGISTER.protocolClassToType.get(protocol);
|
||||
return classToTypesForProtocol == null ? null : classToTypesForProtocol.get(packet);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user