help message work
This commit is contained in:
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) {
|
private void registerCommands(NpcRegistryImpl npcRegistry, SkinCache skinCache, BukkitAudiences adventure, ActionRegistry actionRegistry, NpcTypeRegistryImpl typeRegistry, EntityPropertyRegistryImpl propertyRegistry) {
|
||||||
Reader reader = getTextResource("help-message.txt");
|
Reader reader = getTextResource("help-message.txt");
|
||||||
if (reader == null) throw new RuntimeException("help-message.txt is missing from the ZNpcsPlus jar!");
|
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> helpMessage = context -> context.send(component);
|
||||||
Message<CommandContext> incorrectUsageMessage = context -> context.send(Component.text("Incorrect usage: /" + context.getUsage(), NamedTextColor.RED));
|
Message<CommandContext> incorrectUsageMessage = context -> context.send(Component.text("Incorrect usage: /" + context.getUsage(), NamedTextColor.RED));
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<red>Test Help Message!!!!!
|
|
||||||
<#FF0000>red
|
<gold><bold>ZNPCsPlus v{version}
|
||||||
<#00FF00>green
|
<gray>Hover over any command for example usage
|
||||||
<#0000FF>blue
|
|
||||||
|
TODO
|
||||||
|
|
Loading…
Reference in a new issue