help message work

This commit is contained in:
Pyrbu 2023-06-14 14:25:09 +02:00
parent ae4103b8cb
commit 17f7b36f81
2 changed files with 6 additions and 5 deletions

@ -212,7 +212,7 @@ public class ZNpcsPlus extends JavaPlugin {
private void registerCommands(NpcRegistryImpl npcRegistry, SkinCache skinCache, BukkitAudiences adventure, ActionRegistry actionRegistry, NpcTypeRegistryImpl typeRegistry, EntityPropertyRegistryImpl propertyRegistry) {
Reader reader = getTextResource("help-message.txt");
if (reader == null) throw new RuntimeException("help-message.txt is missing from the ZNpcsPlus jar!");
Component component = MiniMessage.miniMessage().deserialize(FileUtil.dumpReaderAsString(reader));
Component component = MiniMessage.miniMessage().deserialize(FileUtil.dumpReaderAsString(reader).replace("{version}", this.getDescription().getVersion()));
Message<CommandContext> helpMessage = context -> context.send(component);
Message<CommandContext> incorrectUsageMessage = context -> context.send(Component.text("Incorrect usage: /" + context.getUsage(), NamedTextColor.RED));

@ -1,4 +1,5 @@
<red>Test Help Message!!!!!
<#FF0000>red
<#00FF00>green
<#0000FF>blue
<gold><bold>ZNPCsPlus v{version}
<gray>Hover over any command for example usage
TODO