diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandTools/MVCommandManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandTools/MVCommandManager.java index 81794274..ec9e7555 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandTools/MVCommandManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandTools/MVCommandManager.java @@ -36,6 +36,7 @@ import com.onarandombox.MultiverseCore.commands.PurgeCommand; import com.onarandombox.MultiverseCore.commands.RegenCommand; import com.onarandombox.MultiverseCore.commands.ReloadCommand; import com.onarandombox.MultiverseCore.commands.RemoveCommand; +import com.onarandombox.MultiverseCore.commands.RootCommand; import com.onarandombox.MultiverseCore.commands.ScriptCommand; import com.onarandombox.MultiverseCore.commands.SetSpawnCommand; import com.onarandombox.MultiverseCore.commands.SilentCommand; @@ -45,6 +46,10 @@ import com.onarandombox.MultiverseCore.commands.UnloadCommand; import com.onarandombox.MultiverseCore.commands.UsageCommand; import com.onarandombox.MultiverseCore.commands.VersionCommand; import com.onarandombox.MultiverseCore.commands.WhoCommand; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.PluginDescriptionFile; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -97,6 +102,7 @@ public class MVCommandManager extends PaperCommandManager { registerCommand(new BedCommand(this.plugin)); registerCommand(new AnchorCommand(this.plugin)); registerCommand(new WhoCommand(this.plugin)); + registerCommand(new RootCommand(this.plugin)); } @Override @@ -157,4 +163,13 @@ public class MVCommandManager extends PaperCommandManager { public CommandQueueManager getQueueManager() { return commandQueueManager; } + + public void showPluginInfo(@NotNull CommandSender sender, + @NotNull PluginDescriptionFile description, + @NotNull ColourAlternator colour, + @NotNull String baseCommand) { + + sender.sendMessage(colour.getColorThis() + description.getName() + ChatColor.DARK_GRAY + " | " + colour.getColorThat() + "v" + description.getVersion()); + sender.sendMessage(ChatColor.DARK_GREEN + "See " + ChatColor.GREEN + "/" + baseCommand + " help " + ChatColor.DARK_GREEN + "for commands available."); + } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RootCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RootCommand.java new file mode 100644 index 00000000..3a2a345c --- /dev/null +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RootCommand.java @@ -0,0 +1,25 @@ +package com.onarandombox.MultiverseCore.commands; + +import co.aikar.commands.annotation.CommandAlias; +import com.onarandombox.MultiverseCore.MultiverseCore; +import com.onarandombox.MultiverseCore.commandTools.ColourAlternator; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; + +public class RootCommand extends MultiverseCommand { + + public RootCommand(MultiverseCore plugin) { + super(plugin); + } + + @CommandAlias("mv") + public void onRootCommand(@NotNull CommandSender sender) { + this.plugin.getMVCommandManager().showPluginInfo( + sender, + this.plugin.getDescription(), + new ColourAlternator(ChatColor.GOLD, ChatColor.YELLOW), + "mv" + ); + } +}