37 lines
1.2 KiB
Java
37 lines
1.2 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
|
|
*/
|
|
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 java.util.Locale;
|
|
import java.util.Optional;
|
|
import net.minecraft.util.datafix.fixes.References;
|
|
|
|
public class OptionsLowerCaseLanguageFix
|
|
extends DataFix {
|
|
public OptionsLowerCaseLanguageFix(Schema outputSchema, boolean changesType) {
|
|
super(outputSchema, changesType);
|
|
}
|
|
|
|
public TypeRewriteRule makeRule() {
|
|
return this.fixTypeEverywhereTyped("OptionsLowerCaseLanguageFix", this.getInputSchema().getType(References.OPTIONS), input -> input.update(DSL.remainderFinder(), tag -> {
|
|
Optional lang = tag.get("lang").asString().result();
|
|
if (lang.isPresent()) {
|
|
return tag.set("lang", tag.createString(((String)lang.get()).toLowerCase(Locale.ROOT)));
|
|
}
|
|
return tag;
|
|
}));
|
|
}
|
|
}
|
|
|