LegacyJigsawRotationFix .java

net.minecraft.util.datafix.fixes.LegacyJigsawRotationFix (class): members: fixProperties, shouldFix, RENAMES. strings: "jigsaw_rotation_fix", "down_south".

net.minecraft.util.datafix.fixesclass33 linescommonextends LegacyAbstractBlockPropertyFix1.0 KB

API Surface (2)

boolean shouldFix(final String blockId)
<T> Dynamic<T> fixProperties(final String blockId, final Dynamic<T> properties)

Fields & Constants (1)

RENAMES

String literals (15)

"down"
"down_south"
"up_north"
"north"
"north_up"
"south"
"south_up"
"west"
"west_up"
"east"
"east_up"
"jigsaw_rotation_fix"
"minecraft:jigsaw"
"facing"
"orientation"

Code Graph: Dependencies (1)

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

Full Source

LegacyJigsawRotationFix.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.datafix.fixes;
2
3
import com.google.common.collect.ImmutableMap;
4
import com.mojang.datafixers.schemas.Schema;
5
import com.mojang.serialization.Dynamic;
6
import java.util.Map;
7
8
public class LegacyJigsawRotationFix extends LegacyAbstractBlockPropertyFix {
9
	private static final Map<String, String> RENAMES = ImmutableMap.<String, String>builder()
10
		.put("down", "down_south")
11
		.put("up", "up_north")
12
		.put("north", "north_up")
13
		.put("south", "south_up")
14
		.put("west", "west_up")
15
		.put("east", "east_up")
16
		.build();
17
18
	public LegacyJigsawRotationFix(final Schema outputSchema) {
19
		super(outputSchema, "jigsaw_rotation_fix");
20
	}
21
22
	@Override
23
	protected boolean shouldFix(final String blockId) {
24
		return blockId.equals("minecraft:jigsaw");
25
	}
26
27
	@Override
28
	protected <T> Dynamic<T> fixProperties(final String blockId, final Dynamic<T> properties) {
29
		String facing = properties.get("facing").asString("north");
30
		return properties.remove("facing").set("orientation", properties.createString(RENAMES.getOrDefault(facing, facing)));
31
	}
32
}
33

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