DebugProfileRenameEntryFix .java

net.minecraft.util.datafix.fixes.DebugProfileRenameEntryFix (class): members: newName, oldName, makeRule. strings: "DebugProfilePostEffectsFix", "custom".

net.minecraft.util.datafix.fixesclass27 linescommonextends DataFix861 B

API Surface (1)

TypeRewriteRule makeRule()

Fields & Constants (2)

oldName
newName

String literals (2)

"DebugProfilePostEffectsFix"
"custom"

Full Source

DebugProfileRenameEntryFix.java27 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 DebugProfileRenameEntryFix extends DataFix {
9
	private final String oldName;
10
	private final String newName;
11
12
	public DebugProfileRenameEntryFix(final Schema outputSchema, final String oldName, final String newName) {
13
		super(outputSchema, false);
14
		this.oldName = oldName;
15
		this.newName = newName;
16
	}
17
18
	@Override
19
	protected TypeRewriteRule makeRule() {
20
		return this.fixTypeEverywhereTyped(
21
			"DebugProfilePostEffectsFix",
22
			this.getInputSchema().getType(References.DEBUG_PROFILE),
23
			input -> input.update(DSL.remainderFinder(), remainder -> remainder.update("custom", custom -> custom.renameField(this.oldName, this.newName)))
24
		);
25
	}
26
}
27

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