mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 20:47:01 +01:00
Add root command to show plugin info.
This commit is contained in:
parent
e4a6e8a9ec
commit
20b492fa3c
@ -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.");
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user