Skip to content

Commit

Permalink
Update parser used in the codec
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Nov 15, 2024
1 parent f91f40b commit 7233a2f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.mojang.datafixers.util.Either;
import com.mojang.serialization.Codec;
import eu.pb4.placeholders.api.ParserContext;
import eu.pb4.placeholders.api.TextParserUtils;
import eu.pb4.placeholders.api.parsers.TagParser;
import net.minecraft.text.Text;
import net.minecraft.text.TextCodecs;
import net.minecraft.util.dynamic.Codecs;
Expand All @@ -11,7 +13,7 @@

public final class PlasmidCodecs {
public static Codec<Text> TEXT = Codec.either(Codec.STRING, TextCodecs.CODEC)
.xmap(either -> either.map(TextParserUtils::formatTextSafe, Function.identity()), Either::right);
.xmap(either -> either.map((s) -> TagParser.QUICK_TEXT_WITH_STF.parseText(s, ParserContext.of()), Function.identity()), Either::right);

private PlasmidCodecs() {}

Expand Down

0 comments on commit 7233a2f

Please sign in to comment.