Package net.minecraft.network
Enum ProtocolType
- java.lang.Object
-
- java.lang.Enum<ProtocolType>
-
- net.minecraft.network.ProtocolType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ProtocolType>
public enum ProtocolType extends java.lang.Enum<ProtocolType>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classProtocolType.PacketList<T extends INetHandler>(package private) static classProtocolType.PacketRegistry
-
Enum Constant Summary
Enum Constants Enum Constant Description HANDSHAKINGLOGINPLAYSTATUS
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<PacketDirection,? extends ProtocolType.PacketList<?>>flowsprivate intidprivate static ProtocolType[]LOOKUPprivate static java.util.Map<java.lang.Class<? extends IPacket<?>>,ProtocolType>PROTOCOL_BY_PACKET
-
Constructor Summary
Constructors Modifier Constructor Description privateProtocolType(int p_i226083_3_, ProtocolType.PacketRegistry p_i226083_4_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IPacket<?>createPacket(PacketDirection p_179244_1_, int p_179244_2_)static ProtocolTypegetById(int p_150760_0_)intgetId()java.lang.IntegergetPacketId(PacketDirection p_179246_1_, IPacket<?> p_179246_2_)static ProtocolTypegetProtocolForPacket(IPacket<?> p_150752_0_)private static ProtocolType.PacketRegistryprotocol()static ProtocolTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ProtocolType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HANDSHAKING
public static final ProtocolType HANDSHAKING
-
PLAY
public static final ProtocolType PLAY
-
STATUS
public static final ProtocolType STATUS
-
LOGIN
public static final ProtocolType LOGIN
-
-
Field Detail
-
LOOKUP
private static final ProtocolType[] LOOKUP
-
PROTOCOL_BY_PACKET
private static final java.util.Map<java.lang.Class<? extends IPacket<?>>,ProtocolType> PROTOCOL_BY_PACKET
-
id
private final int id
-
flows
private final java.util.Map<PacketDirection,? extends ProtocolType.PacketList<?>> flows
-
-
Constructor Detail
-
ProtocolType
private ProtocolType(int p_i226083_3_, ProtocolType.PacketRegistry p_i226083_4_)
-
-
Method Detail
-
values
public static ProtocolType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProtocolType c : ProtocolType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProtocolType valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
protocol
private static ProtocolType.PacketRegistry protocol()
-
getPacketId
@Nullable public java.lang.Integer getPacketId(PacketDirection p_179246_1_, IPacket<?> p_179246_2_)
-
createPacket
@Nullable public IPacket<?> createPacket(PacketDirection p_179244_1_, int p_179244_2_)
-
getId
public int getId()
-
getById
@Nullable public static ProtocolType getById(int p_150760_0_)
-
getProtocolForPacket
public static ProtocolType getProtocolForPacket(IPacket<?> p_150752_0_)
-
-