Skip to content

Commit

Permalink
fix styled output
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Nov 8, 2024
1 parent 740c3df commit 40be52f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package folk.sisby.switchy.modules;

import eu.pb4.placeholders.api.Placeholders;
import eu.pb4.placeholders.api.ParserContext;
import eu.pb4.placeholders.api.TextParserUtils;
import eu.pb4.stylednicknames.NicknameHolder;
import eu.pb4.stylednicknames.config.Config;
import eu.pb4.stylednicknames.config.ConfigManager;
import folk.sisby.switchy.SwitchyCompat;
import folk.sisby.switchy.api.module.SwitchyModule;
Expand All @@ -19,7 +20,6 @@
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

import java.util.Map;
import java.util.Objects;

import static folk.sisby.switchy.util.Feedback.translatable;
Expand Down Expand Up @@ -112,6 +112,6 @@ public Text getText() {
*/
public Text getOutput() {
Text nickname = getText();
return styled_nickname != null ? Placeholders.parseText(ConfigManager.getConfig().nicknameFormat, Placeholders.PREDEFINED_PLACEHOLDER_PATTERN, Map.of("nickname", nickname, "name", nickname)) : null;
return styled_nickname != null ? ConfigManager.getConfig().nicknameFormat.toText(ParserContext.of(Config.KEY, s -> nickname)).copy() : null;
}
}

0 comments on commit 40be52f

Please sign in to comment.