ClientIntent .java

net.minecraft.network.protocol.handshake.ClientIntent (enum, 29 lines): members: STATUS, LOGIN, TRANSFER, TRANSFER_ID, STATUS_ID, LOGIN_ID, byId.

net.minecraft.network.protocol.handshakeenum29 linescommon581 B

API Surface (2)

ClientIntent byId(final int id)
int id()

Fields & Constants (4)

STATUS_ID
LOGIN_ID
TRANSFER_ID
LOGIN

String literals (1)

"Unknown connection intent: "

Full Source

ClientIntent.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.handshake;
2
3
public enum ClientIntent {
4
	STATUS,
5
	LOGIN,
6
	TRANSFER;
7
8
	private static final int STATUS_ID = 1;
9
	private static final int LOGIN_ID = 2;
10
	private static final int TRANSFER_ID = 3;
11
12
	public static ClientIntent byId(final int id) {
13
		return switch (id) {
14
			case 1 -> STATUS;
15
			case 2 -> LOGIN;
16
			case 3 -> TRANSFER;
17
			default -> throw new IllegalArgumentException("Unknown connection intent: " + id);
18
		};
19
	}
20
21
	public int id() {
22
		return switch (this) {
23
			case STATUS -> 1;
24
			case LOGIN -> 2;
25
			case TRANSFER -> 3;
26
		};
27
	}
28
}
29

Decompiled Minecraft 26.3 source of ClientIntent (net/minecraft/network/protocol/handshake/ClientIntent.java) with Mojang official mappings, stored verbatim on the site.