41 lines
1.5 KiB
Java
41 lines
1.5 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.datafixers.DSL
|
|
* com.mojang.datafixers.DataFix
|
|
* com.mojang.datafixers.TypeRewriteRule
|
|
* com.mojang.datafixers.schemas.Schema
|
|
* com.mojang.datafixers.types.Type
|
|
* com.mojang.serialization.Dynamic
|
|
* com.mojang.serialization.OptionalDynamic
|
|
*/
|
|
package net.minecraft.util.datafix.fixes;
|
|
|
|
import com.mojang.datafixers.DSL;
|
|
import com.mojang.datafixers.DataFix;
|
|
import com.mojang.datafixers.TypeRewriteRule;
|
|
import com.mojang.datafixers.schemas.Schema;
|
|
import com.mojang.datafixers.types.Type;
|
|
import com.mojang.serialization.Dynamic;
|
|
import com.mojang.serialization.OptionalDynamic;
|
|
import net.minecraft.util.datafix.fixes.References;
|
|
|
|
public class BlendingDataRemoveFromNetherEndFix
|
|
extends DataFix {
|
|
public BlendingDataRemoveFromNetherEndFix(Schema outputSchema) {
|
|
super(outputSchema, false);
|
|
}
|
|
|
|
protected TypeRewriteRule makeRule() {
|
|
Type chunkType = this.getOutputSchema().getType(References.CHUNK);
|
|
return this.fixTypeEverywhereTyped("BlendingDataRemoveFromNetherEndFix", chunkType, chunk -> chunk.update(DSL.remainderFinder(), chunkTag -> BlendingDataRemoveFromNetherEndFix.updateChunkTag(chunkTag, chunkTag.get("__context"))));
|
|
}
|
|
|
|
private static Dynamic<?> updateChunkTag(Dynamic<?> chunkTag, OptionalDynamic<?> contextTag) {
|
|
boolean isOverworld = "minecraft:overworld".equals(contextTag.get("dimension").asString().result().orElse(""));
|
|
return isOverworld ? chunkTag : chunkTag.remove("blending_data");
|
|
}
|
|
}
|
|
|