Use TagResolver instead of Template
This commit is contained in:
parent
6541e4c93c
commit
eb893d62c9
1 changed files with 6 additions and 4 deletions
|
|
@ -28,7 +28,8 @@ import net.frankheijden.serverutils.common.utils.KeyValueComponentBuilder;
|
|||
import net.frankheijden.serverutils.common.utils.ForwardFilter;
|
||||
import net.frankheijden.serverutils.common.utils.ListComponentBuilder;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
|
|
@ -126,7 +127,7 @@ public class BukkitCommandServerUtils extends CommandServerUtils<BukkitPlugin, P
|
|||
if (handler == null) {
|
||||
messages.get(BukkitMessageKey.RELOADCONFIG_NOT_EXISTS).sendTo(
|
||||
sender,
|
||||
Template.of("config", config)
|
||||
TagResolver.resolver("config", Tag.inserting(Component.text(config)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -138,7 +139,7 @@ public class BukkitCommandServerUtils extends CommandServerUtils<BukkitPlugin, P
|
|||
if (MinecraftReflectionVersion.MINOR > max) {
|
||||
messages.get(BukkitMessageKey.RELOADCONFIG_NOT_SUPPORTED).sendTo(
|
||||
sender,
|
||||
Template.of("config", config)
|
||||
TagResolver.resolver("config", Tag.inserting(Component.text(config)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -153,7 +154,8 @@ public class BukkitCommandServerUtils extends CommandServerUtils<BukkitPlugin, P
|
|||
BukkitMessageKey key = filter.hasWarnings()
|
||||
? BukkitMessageKey.RELOADCONFIG_WARNINGS
|
||||
: BukkitMessageKey.RELOADCONFIG_SUCCESS;
|
||||
plugin.getMessagesResource().get(key).sendTo(sender, Template.of("config", config));
|
||||
plugin.getMessagesResource().get(key).sendTo(sender, TagResolver.resolver("config",
|
||||
Tag.inserting(Component.text(config))));
|
||||
} catch (Exception ex) {
|
||||
filter.stop(Bukkit.getLogger());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue