public enum NetworkState extends Enum<NetworkState>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
NetworkState.PacketHandler<T extends PacketListener> |
(package private) static class |
NetworkState.PacketHandlerInitializer |
Enum Constant and Description |
---|
HANDSHAKING |
LOGIN |
PLAY |
STATUS |
Modifier and Type | Field and Description |
---|---|
private static Map<Class<? extends Packet<?>>,NetworkState> |
HANDLER_STATE_MAP |
private Map<NetworkSide,? extends NetworkState.PacketHandler<?>> |
packetHandlers |
private int |
stateId |
private static NetworkState[] |
STATES |
Modifier and Type | Method and Description |
---|---|
static NetworkState |
byId(int id) |
private static NetworkState.PacketHandlerInitializer |
createPacketHandlerInitializer() |
int |
getId() |
Packet<?> |
getPacketHandler(NetworkSide side,
int packetId) |
static NetworkState |
getPacketHandlerState(Packet<?> handler) |
Integer |
getPacketId(NetworkSide side,
Packet<?> packet) |
static NetworkState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NetworkState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NetworkState HANDSHAKING
public static final NetworkState PLAY
public static final NetworkState STATUS
public static final NetworkState LOGIN
private static final NetworkState[] STATES
private static final Map<Class<? extends Packet<?>>,NetworkState> HANDLER_STATE_MAP
private final int stateId
private final Map<NetworkSide,? extends NetworkState.PacketHandler<?>> packetHandlers
public static NetworkState[] values()
for (NetworkState c : NetworkState.values()) System.out.println(c);
public static NetworkState valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprivate static NetworkState.PacketHandlerInitializer createPacketHandlerInitializer()
@Nullable public Integer getPacketId(NetworkSide side, Packet<?> packet)
@Nullable public Packet<?> getPacketHandler(NetworkSide side, int packetId)
public int getId()
@Nullable public static NetworkState byId(int id)
public static NetworkState getPacketHandlerState(Packet<?> handler)