V4290 .java

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

net.minecraft.util.datafix.schemasclass48 linescommonextends NamespacedSchema1.5 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 (8)

"extra"
"separator"
"hoverEvent"
"action"
"show_text"
"contents"
"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

V4290.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 V4290 extends NamespacedSchema {
11
	public V4290(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
					"hoverEvent",
31
					DSL.taggedChoice(
32
						"action",
33
						DSL.string(),
34
						Map.of(
35
							"show_text",
36
							DSL.optionalFields("contents", References.TEXT_COMPONENT.in(schema)),
37
							"show_item",
38
							DSL.optionalFields("contents", DSL.or(References.ITEM_STACK.in(schema), References.ITEM_NAME.in(schema))),
39
							"show_entity",
40
							DSL.optionalFields("type", 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 V4290 (net/minecraft/util/datafix/schemas/V4290.java) with Mojang official mappings, stored verbatim on the site.