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.