Package net.minecraft.network
Enum NetworkState
- All Implemented Interfaces:
Serializable
,Comparable<NetworkState>
,java.lang.constant.Constable
public enum NetworkState extends Enum<NetworkState>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
NetworkState.PacketHandler<T extends PacketListener>
(package private) static class
NetworkState.PacketHandlerInitializer
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description HANDSHAKING
LOGIN
PLAY
STATUS
-
Field Summary
Fields Modifier and Type Field 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
-
Constructor Summary
Constructors Modifier Constructor Description private
NetworkState(int id, NetworkState.PacketHandlerInitializer packetHandlerInitializer)
-
Method Summary
Modifier and Type Method 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.
-
Enum Constant Details
-
HANDSHAKING
-
PLAY
-
STATUS
-
LOGIN
-
-
Field Details
-
STATES
-
HANDLER_STATE_MAP
-
stateId
private final int stateId -
packetHandlers
-
-
Constructor Details
-
NetworkState
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
createPacketHandlerInitializer
-
getPacketId
-
getPacketHandler
-
getId
public int getId() -
byId
-
getPacketHandlerState
-