DialogAction .java

net.minecraft.server.dialog.DialogAction (enum): members: CLOSE, NONE, WAIT_FOR_RESPONSE, willUnpause, BY_ID, getSerializedName, name, STREAM_CODEC, CODEC.

net.minecraft.server.dialogenum36 linesserver1.1 KB

Implements

API Surface (2)

String getSerializedName()
boolean willUnpause()

Fields & Constants (5)

BY_ID
CODEC
STREAM_CODEC
id
name

String literals (3)

"close"
"none"
"wait_for_response"

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

DialogAction.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.server.dialog;
2
3
import com.mojang.serialization.Codec;
4
import io.netty.buffer.ByteBuf;
5
import java.util.function.IntFunction;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.util.ByIdMap;
9
import net.minecraft.util.StringRepresentable;
10
11
public enum DialogAction implements StringRepresentable {
12
	CLOSE(0, "close"),
13
	NONE(1, "none"),
14
	WAIT_FOR_RESPONSE(2, "wait_for_response");
15
16
	public static final IntFunction<DialogAction> BY_ID = ByIdMap.continuous(s -> s.id, values(), ByIdMap.OutOfBoundsStrategy.ZERO);
17
	public static final Codec<DialogAction> CODEC = StringRepresentable.fromEnum(DialogAction::values);
18
	public static final StreamCodec<ByteBuf, DialogAction> STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, s -> s.id);
19
	private final int id;
20
	private final String name;
21
22
	DialogAction(final int id, final String name) {
23
		this.id = id;
24
		this.name = name;
25
	}
26
27
	@Override
28
	public String getSerializedName() {
29
		return this.name;
30
	}
31
32
	public boolean willUnpause() {
33
		return this == CLOSE || this == WAIT_FOR_RESPONSE;
34
	}
35
}
36

Decompiled Minecraft 26.3 source of DialogAction (net/minecraft/server/dialog/DialogAction.java) with Mojang official mappings, stored verbatim on the site.