PlayerRespawnDataFix .java

net.minecraft.util.datafix.fixes.PlayerRespawnDataFix (class): members: makeRule. strings: "respawn", "angle", "pitch", "minecraft:overworld", "dimension".

net.minecraft.util.datafix.fixesclass31 linescommonextends DataFix920 B

API Surface (1)

TypeRewriteRule makeRule()

String literals (5)

"respawn"
"dimension"
"minecraft:overworld"
"angle"
"pitch"

Full Source

PlayerRespawnDataFix.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.datafix.fixes;
2
3
import com.mojang.datafixers.DSL;
4
import com.mojang.datafixers.DataFix;
5
import com.mojang.datafixers.TypeRewriteRule;
6
import com.mojang.datafixers.schemas.Schema;
7
8
public class PlayerRespawnDataFix extends DataFix {
9
	public PlayerRespawnDataFix(final Schema outputSchema) {
10
		super(outputSchema, false);
11
	}
12
13
	@Override
14
	protected TypeRewriteRule makeRule() {
15
		return this.fixTypeEverywhereTyped(
16
			"PlayerRespawnDataFix",
17
			this.getInputSchema().getType(References.PLAYER),
18
			input -> input.update(
19
				DSL.remainderFinder(),
20
				tag -> tag.update(
21
					"respawn",
22
					respawnTag -> respawnTag.set("dimension", respawnTag.createString(respawnTag.get("dimension").asString("minecraft:overworld")))
23
						.set("yaw", respawnTag.createFloat(respawnTag.get("angle").asFloat(0.0F)))
24
						.set("pitch", respawnTag.createFloat(0.0F))
25
						.remove("angle")
26
				)
27
			)
28
		);
29
	}
30
}
31

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