V4292 .java

net.minecraft.util.datafix.schemas.V4292 (class): members: registerTypes, entityTypes. strings: "hover_event", "show_entity", "show_item", "show_text".

net.minecraft.util.datafix.schemasclass48 linescommonextends NamespacedSchema1.4 KB

API Surface (1)

void registerTypes(final Schema schema, final Map<String, Supplier<TypeTemplate>> entityTypes, final Map<String, Supplier<TypeTemplate>> blockEntityTypes)

Fields & Constants (1)

entityTypes

String literals (7)

"extra"
"separator"
"hover_event"
"action"
"show_text"
"show_item"
"show_entity"

Code Graph: Dependencies (2)

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

Full Source

V4292.java48 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.datafix.schemas;
2
3
import com.mojang.datafixers.DSL;
4
import com.mojang.datafixers.schemas.Schema;
5
import com.mojang.datafixers.types.templates.TypeTemplate;
6
import java.util.Map;
7
import java.util.function.Supplier;
8
import net.minecraft.util.datafix.fixes.References;
9
10
public class V4292 extends NamespacedSchema {
11
	public V4292(final int versionKey, final Schema parent) {
12
		super(versionKey, parent);
13
	}
14
15
	@Override
16
	public void registerTypes(
17
		final Schema schema, final Map<String, Supplier<TypeTemplate>> entityTypes, final Map<String, Supplier<TypeTemplate>> blockEntityTypes
18
	) {
19
		super.registerTypes(schema, entityTypes, blockEntityTypes);
20
		schema.registerType(
21
			true,
22
			References.TEXT_COMPONENT,
23
			() -> DSL.or(
24
				DSL.or(DSL.constType(DSL.string()), DSL.list(References.TEXT_COMPONENT.in(schema))),
25
				DSL.optionalFields(
26
					"extra",
27
					DSL.list(References.TEXT_COMPONENT.in(schema)),
28
					"separator",
29
					References.TEXT_COMPONENT.in(schema),
30
					"hover_event",
31
					DSL.taggedChoice(
32
						"action",
33
						DSL.string(),
34
						Map.of(
35
							"show_text",
36
							DSL.optionalFields("value", References.TEXT_COMPONENT.in(schema)),
37
							"show_item",
38
							References.ITEM_STACK.in(schema),
39
							"show_entity",
40
							DSL.optionalFields("id", References.ENTITY_NAME.in(schema), "name", References.TEXT_COMPONENT.in(schema))
41
						)
42
					)
43
				)
44
			)
45
		);
46
	}
47
}
48

Decompiled Minecraft 26.3 source of V4292 (net/minecraft/util/datafix/schemas/V4292.java) with Mojang official mappings, stored verbatim on the site.