ClientIntent.java
net.minecraft.network.protocol.handshake.ClientIntent
信息
- 全限定名:net.minecraft.network.protocol.handshake.ClientIntent
- 类型:public enum
- 包:net.minecraft.network.protocol.handshake
- 源码路径:src/main/java/net/minecraft/network/protocol/handshake/ClientIntent.java
- 起始行号:L3
- 职责:
TODO
字段/常量
-
STATUS, LOGIN, TRANSFER- 类型:
ClientIntent - 修饰符:
package-private - 源码定位:
L4 - 说明:
TODO
- 类型:
-
STATUS_ID- 类型:
int - 修饰符:
private static final - 源码定位:
L8 - 说明:
TODO
- 类型:
-
LOGIN_ID- 类型:
int - 修饰符:
private static final - 源码定位:
L9 - 说明:
TODO
- 类型:
-
TRANSFER_ID- 类型:
int - 修饰符:
private static final - 源码定位:
L10 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public static ClientIntent byId(int id) @ L12
- 方法名:byId
- 源码定位:L12
- 返回类型:ClientIntent
- 修饰符:public static
参数:
- id: int
说明:
TODO
public int id() @ L21
- 方法名:id
- 源码定位:L21
- 返回类型:int
- 修饰符:public
参数:
- 无
说明:
TODO
代码
public enum ClientIntent {
STATUS,
LOGIN,
TRANSFER;
private static final int STATUS_ID = 1;
private static final int LOGIN_ID = 2;
private static final int TRANSFER_ID = 3;
public static ClientIntent byId(int id) {
return switch (id) {
case 1 -> STATUS;
case 2 -> LOGIN;
case 3 -> TRANSFER;
default -> throw new IllegalArgumentException("Unknown connection intent: " + id);
};
}
public int id() {
return switch (this) {
case STATUS -> 1;
case LOGIN -> 2;
case TRANSFER -> 3;
};
}
}引用的其他类
- 无