API Surface (1) MapCodec<BooleanInput> mapCodec()
String literals (3) "initial"
"on_true"
"on_false"
Code Graph: Dependencies (3) Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.
Full Source
BooleanInput.java 25 lines · Minecraft 26.3 · verbatim Copy
1 package net.minecraft.server.dialog.input;
2
3 import com.mojang.serialization.Codec;
4 import com.mojang.serialization.MapCodec;
5 import com.mojang.serialization.codecs.RecordCodecBuilder;
6 import net.minecraft.network.chat.Component;
7 import net.minecraft.network.chat.ComponentSerialization;
8
9 public record BooleanInput(Component label, boolean initial, String onTrue, String onFalse) implements InputControl {
10 public static final MapCodec<BooleanInput> MAP_CODEC = RecordCodecBuilder.mapCodec(
11 i -> i.group(
12 ComponentSerialization.CODEC.fieldOf("label").forGetter(BooleanInput::label),
13 Codec.BOOL.optionalFieldOf("initial", false).forGetter(BooleanInput::initial),
14 Codec.STRING.optionalFieldOf("on_true", "true").forGetter(BooleanInput::onTrue),
15 Codec.STRING.optionalFieldOf("on_false", "false").forGetter(BooleanInput::onFalse)
16 )
17 .apply(i, BooleanInput::new)
18 );
19
20 @Override
21 public MapCodec<BooleanInput> mapCodec() {
22 return MAP_CODEC;
23 }
24 }
25
Decompiled Minecraft 26.3 source of BooleanInput (net/minecraft/server/dialog/input/BooleanInput.java) with Mojang official mappings, stored verbatim on the site.