ChunkDeleteLightFix .java

net.minecraft.util.datafix.fixes.ChunkDeleteLightFix (class): members: makeRule. strings: "ChunkDeleteLightFix for ", "BlockLight", "SkyLight", "sections".

net.minecraft.util.datafix.fixesclass25 linescommonextends DataFix987 B

API Surface (1)

TypeRewriteRule makeRule()

String literals (5)

"sections"
"ChunkDeleteLightFix for "
"isLightOn"
"BlockLight"
"SkyLight"

Full Source

ChunkDeleteLightFix.java25 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.OpticFinder;
6
import com.mojang.datafixers.TypeRewriteRule;
7
import com.mojang.datafixers.schemas.Schema;
8
import com.mojang.datafixers.types.Type;
9
10
public class ChunkDeleteLightFix extends DataFix {
11
	public ChunkDeleteLightFix(final Schema outputSchema) {
12
		super(outputSchema, false);
13
	}
14
15
	@Override
16
	protected TypeRewriteRule makeRule() {
17
		Type<?> chunkType = this.getInputSchema().getType(References.CHUNK);
18
		OpticFinder<?> sectionsFinder = chunkType.findField("sections");
19
		return this.fixTypeEverywhereTyped("ChunkDeleteLightFix for " + this.getOutputSchema().getVersionKey(), chunkType, chunk -> {
20
			chunk = chunk.update(DSL.remainderFinder(), tag -> tag.remove("isLightOn"));
21
			return chunk.updateTyped(sectionsFinder, section -> section.update(DSL.remainderFinder(), tag -> tag.remove("BlockLight").remove("SkyLight")));
22
		});
23
	}
24
}
25

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