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 classNetworkState.PacketHandler<T extends PacketListener>(package private) static classNetworkState.PacketHandlerInitializerNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants Enum Constant Description HANDSHAKINGLOGINPLAYSTATUS -
Field Summary
Fields Modifier and Type Field Description private static Map<Class<? extends Packet<?>>,NetworkState>HANDLER_STATE_MAPprivate Map<NetworkSide,? extends NetworkState.PacketHandler<?>>packetHandlersprivate intstateIdprivate static NetworkState[]STATES -
Constructor Summary
Constructors Modifier Constructor Description privateNetworkState(int id, NetworkState.PacketHandlerInitializer packetHandlerInitializer) -
Method Summary
Modifier and Type Method Description static NetworkStatebyId(int id)private static NetworkState.PacketHandlerInitializercreatePacketHandlerInitializer()intgetId()Packet<?>getPacketHandler(NetworkSide side, int packetId)static NetworkStategetPacketHandlerState(Packet<?> handler)IntegergetPacketId(NetworkSide side, Packet<?> packet)static NetworkStatevalueOf(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
-