public static PacketType fromCurrent(Protocol protocol, Sender sender, int packetId, Class<?> packetClass) {
ClassLookup lookup = getLookup().getClassLookup();
Map<String, PacketType> map = lookup.getMap(protocol, sender);
String clazz = packetClass.getSimpleName();
PacketType type = find(map, clazz);
if (type == null) {
type = new PacketType(protocol, sender, packetId, -1, PROTOCOL_VERSION, clazz);
type.dynamic = true;
scheduleRegister(type, "Dynamic-" + UUID.randomUUID().toString());
}
return type;
}