public enum EnumConnectionState extends java.lang.Enum<EnumConnectionState>
Enum Constant and Description |
---|
HANDSHAKING |
LOGIN |
PLAY |
STATUS |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<EnumPacketDirection,com.google.common.collect.BiMap<java.lang.Integer,java.lang.Class<? extends Packet<?>>>> |
directionMaps |
private int |
id |
private static java.util.Map<java.lang.Class<? extends Packet<?>>,EnumConnectionState> |
STATES_BY_CLASS |
private static EnumConnectionState[] |
STATES_BY_ID |
Modifier and Type | Method and Description |
---|---|
static EnumConnectionState |
getById(int stateId) |
static EnumConnectionState |
getFromPacket(Packet<?> packetIn) |
int |
getId() |
Packet<?> |
getPacket(EnumPacketDirection direction,
int packetId) |
java.lang.Integer |
getPacketId(EnumPacketDirection direction,
Packet<?> packetIn) |
protected EnumConnectionState |
registerPacket(EnumPacketDirection direction,
java.lang.Class<? extends Packet<?>> packetClass) |
static EnumConnectionState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static EnumConnectionState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EnumConnectionState HANDSHAKING
public static final EnumConnectionState PLAY
public static final EnumConnectionState STATUS
public static final EnumConnectionState LOGIN
private static final EnumConnectionState[] STATES_BY_ID
private static final java.util.Map<java.lang.Class<? extends Packet<?>>,EnumConnectionState> STATES_BY_CLASS
private final int id
private final java.util.Map<EnumPacketDirection,com.google.common.collect.BiMap<java.lang.Integer,java.lang.Class<? extends Packet<?>>>> directionMaps
public static EnumConnectionState[] values()
for (EnumConnectionState c : EnumConnectionState.values()) System.out.println(c);
public static EnumConnectionState valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullprotected EnumConnectionState registerPacket(EnumPacketDirection direction, java.lang.Class<? extends Packet<?>> packetClass)
public java.lang.Integer getPacketId(EnumPacketDirection direction, Packet<?> packetIn) throws java.lang.Exception
java.lang.Exception
@Nullable public Packet<?> getPacket(EnumPacketDirection direction, int packetId) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public int getId()
public static EnumConnectionState getById(int stateId)
public static EnumConnectionState getFromPacket(Packet<?> packetIn)