package net.minecraft.util.datafix.fixes; 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.datafixers.util.Pair; import net.minecraft.util.datafix.LegacyComponentDataFixUtils; public class TextComponentStrictJsonFix extends DataFix { public TextComponentStrictJsonFix(Schema outputSchema) { super(outputSchema, false); } @Override protected TypeRewriteRule makeRule() { Type> type = (Type>)this.getInputSchema().getType(References.TEXT_COMPONENT); return this.fixTypeEverywhere("TextComponentStrictJsonFix", type, dynamicOps -> pair -> pair.mapSecond(LegacyComponentDataFixUtils::rewriteFromLenient)); } }