PlayerUUIDFix .java

net.minecraft.util.datafix.fixes.PlayerUUIDFix (class): members: makeRule. strings: "Attach", "RootVehicle". imports: OpticFinder, TypeRewriteRule, DSL.

net.minecraft.util.datafix.fixesclass30 linescommonextends AbstractUUIDFix972 B

API Surface (1)

TypeRewriteRule makeRule()

String literals (2)

"RootVehicle"
"Attach"

Code Graph: Dependencies (2)

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

Full Source

PlayerUUIDFix.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.datafix.fixes;
2
3
import com.mojang.datafixers.DSL;
4
import com.mojang.datafixers.OpticFinder;
5
import com.mojang.datafixers.TypeRewriteRule;
6
import com.mojang.datafixers.schemas.Schema;
7
8
public class PlayerUUIDFix extends AbstractUUIDFix {
9
	public PlayerUUIDFix(final Schema outputSchema) {
10
		super(outputSchema, References.PLAYER);
11
	}
12
13
	@Override
14
	protected TypeRewriteRule makeRule() {
15
		return this.fixTypeEverywhereTyped(
16
			"PlayerUUIDFix",
17
			this.getInputSchema().getType(this.typeReference),
18
			input -> {
19
				OpticFinder<?> rootVehicleFinder = input.getType().findField("RootVehicle");
20
				return input.updateTyped(
21
						rootVehicleFinder,
22
						rootVehicleFinder.type(),
23
						rootVehicle -> rootVehicle.update(DSL.remainderFinder(), tag -> replaceUUIDLeastMost(tag, "Attach", "Attach").orElse(tag))
24
					)
25
					.update(DSL.remainderFinder(), tag -> EntityUUIDFix.updateEntityUUID(EntityUUIDFix.updateLivingEntity(tag)));
26
			}
27
		);
28
	}
29
}
30

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