From eb6610372e526404ffe7c6ead0b0755964aa52fa Mon Sep 17 00:00:00 2001 From: DongShaoNB Date: Tue, 20 Aug 2024 23:27:49 +0800 Subject: [PATCH] perf: better code --- .../kotlin/cc/dsnb/bedrockplayersupport/util/StringUtil.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/cc/dsnb/bedrockplayersupport/util/StringUtil.kt b/src/main/kotlin/cc/dsnb/bedrockplayersupport/util/StringUtil.kt index 849f8c3..8963b96 100644 --- a/src/main/kotlin/cc/dsnb/bedrockplayersupport/util/StringUtil.kt +++ b/src/main/kotlin/cc/dsnb/bedrockplayersupport/util/StringUtil.kt @@ -36,7 +36,11 @@ object StringUtil { fun formatTextToComponent(player: Player?, originalText: String): Component { return BedrockPlayerSupport.miniMessage.deserialize( - formatTextToString(player, originalText) + if (BedrockPlayerSupport.mainConfigManager.getConfigData().enableSupportPAPI()) { + PlaceholderAPI.setPlaceholders(player, originalText) + } else { + originalText + } ) }