V4301 .java

net.minecraft.util.datafix.schemas.V4301 (class): members: registerTypes, entityTypes. strings: "legs", "mainhand", "offhand", "equipment", "feet", "head".

net.minecraft.util.datafix.schemasclass42 linescommonextends NamespacedSchema1.3 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 (9)

"equipment"
"mainhand"
"offhand"
"feet"
"legs"
"chest"
"head"
"body"
"saddle"

Code Graph: Dependencies (2)

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

Full Source

V4301.java42 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 com.mojang.datafixers.util.Pair;
7
import java.util.Map;
8
import java.util.function.Supplier;
9
import net.minecraft.util.datafix.fixes.References;
10
11
public class V4301 extends NamespacedSchema {
12
	public V4301(final int versionKey, final Schema parent) {
13
		super(versionKey, parent);
14
	}
15
16
	@Override
17
	public void registerTypes(
18
		final Schema schema, final Map<String, Supplier<TypeTemplate>> entityTypes, final Map<String, Supplier<TypeTemplate>> blockEntityTypes
19
	) {
20
		super.registerTypes(schema, entityTypes, blockEntityTypes);
21
		schema.registerType(
22
			true,
23
			References.ENTITY_EQUIPMENT,
24
			() -> DSL.optional(
25
				DSL.field(
26
					"equipment",
27
					DSL.optionalFields(
28
						Pair.of("mainhand", References.ITEM_STACK.in(schema)),
29
						Pair.of("offhand", References.ITEM_STACK.in(schema)),
30
						Pair.of("feet", References.ITEM_STACK.in(schema)),
31
						Pair.of("legs", References.ITEM_STACK.in(schema)),
32
						Pair.of("chest", References.ITEM_STACK.in(schema)),
33
						Pair.of("head", References.ITEM_STACK.in(schema)),
34
						Pair.of("body", References.ITEM_STACK.in(schema)),
35
						Pair.of("saddle", References.ITEM_STACK.in(schema))
36
					)
37
				)
38
			)
39
		);
40
	}
41
}
42

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