Dialog .java

net.minecraft.server.dialog.Dialog (interface): members: WIDTH_CODEC, CONTEXT_FREE_STREAM_CODEC, onCancel, common, LIST_CODEC, DIRECT_CODEC, STREAM_CODEC.

net.minecraft.server.dialoginterface34 linesserver1.4 KB

API Surface (0)

No public/protected methods detected (fields or constants only).

Fields & Constants (6)

WIDTH_CODEC
DIRECT_CODEC
CODEC
LIST_CODEC
STREAM_CODEC
CONTEXT_FREE_STREAM_CODEC

Full Source

Dialog.java34 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.server.dialog;
2
3
import com.mojang.serialization.Codec;
4
import com.mojang.serialization.MapCodec;
5
import io.netty.buffer.ByteBuf;
6
import java.util.Optional;
7
import net.minecraft.core.Holder;
8
import net.minecraft.core.HolderSet;
9
import net.minecraft.core.registries.BuiltInRegistries;
10
import net.minecraft.core.registries.Registries;
11
import net.minecraft.core.registries.codec.RegistryCodecs;
12
import net.minecraft.network.RegistryFriendlyByteBuf;
13
import net.minecraft.network.codec.ByteBufCodecs;
14
import net.minecraft.network.codec.StreamCodec;
15
import net.minecraft.server.dialog.action.Action;
16
import net.minecraft.util.ExtraCodecs;
17
18
public interface Dialog {
19
	Codec<Integer> WIDTH_CODEC = ExtraCodecs.intRange(1, 1024);
20
	Codec<Dialog> DIRECT_CODEC = BuiltInRegistries.DIALOG_TYPE.byNameCodec().dispatch(Dialog::codec, c -> c);
21
	Codec<Holder<Dialog>> CODEC = RegistryCodecs.holder(Registries.DIALOG, DIRECT_CODEC);
22
	Codec<HolderSet<Dialog>> LIST_CODEC = RegistryCodecs.holderSet(Registries.DIALOG, DIRECT_CODEC);
23
	StreamCodec<RegistryFriendlyByteBuf, Holder<Dialog>> STREAM_CODEC = ByteBufCodecs.holder(
24
		Registries.DIALOG, ByteBufCodecs.fromCodecWithRegistriesTrusted(DIRECT_CODEC)
25
	);
26
	StreamCodec<ByteBuf, Dialog> CONTEXT_FREE_STREAM_CODEC = ByteBufCodecs.fromCodecTrusted(DIRECT_CODEC);
27
28
	CommonDialogData common();
29
30
	MapCodec<? extends Dialog> codec();
31
32
	Optional<Action> onCancel();
33
}
34

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