static class NetworkState.PacketHandler<T extends PacketListener> extends Object
Modifier and Type | Field and Description |
---|---|
private List<Supplier<? extends Packet<T>>> |
packetFactories |
private it.unimi.dsi.fastutil.objects.Object2IntMap<Class<? extends Packet<T>>> |
packetIds |
Modifier | Constructor and Description |
---|---|
private |
PacketHandler() |
Modifier and Type | Method and Description |
---|---|
Packet<?> |
createPacket(int id) |
Integer |
getId(Class<?> packet) |
Iterable<Class<? extends Packet<?>>> |
getPacketTypes() |
<P extends Packet<T>> |
register(Class<P> type,
Supplier<P> factory) |
private final it.unimi.dsi.fastutil.objects.Object2IntMap<Class<? extends Packet<T extends PacketListener>>> packetIds
private final List<Supplier<? extends Packet<T extends PacketListener>>> packetFactories