WriteAndReadFix .java

net.minecraft.util.datafix.fixes.WriteAndReadFix (class, 23 lines): members: makeRule, name, type. imports: TypeReference, DataFix, TypeRewriteRule.

net.minecraft.util.datafix.fixesclass23 linescommonextends DataFix683 B

API Surface (1)

TypeRewriteRule makeRule()

Fields & Constants (2)

name
type

Full Source

WriteAndReadFix.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.datafix.fixes;
2
3
import com.mojang.datafixers.DataFix;
4
import com.mojang.datafixers.TypeRewriteRule;
5
import com.mojang.datafixers.DSL.TypeReference;
6
import com.mojang.datafixers.schemas.Schema;
7
8
public class WriteAndReadFix extends DataFix {
9
	private final String name;
10
	private final TypeReference type;
11
12
	public WriteAndReadFix(final Schema outputSchema, final String name, final TypeReference type) {
13
		super(outputSchema, true);
14
		this.name = name;
15
		this.type = type;
16
	}
17
18
	@Override
19
	protected TypeRewriteRule makeRule() {
20
		return this.writeAndRead(this.name, this.getInputSchema().getType(this.type), this.getOutputSchema().getType(this.type));
21
	}
22
}
23

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