help me
This commit is contained in:
parent
12c58e86a2
commit
558f113f9d
2 changed files with 90 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ package de.lunarakai.minecleaner;
|
|||
import de.lunarakai.minecleaner.commands.CreateCommand;
|
||||
import de.lunarakai.minecleaner.commands.DeleteCommand;
|
||||
import de.lunarakai.minecleaner.commands.DeletePlayerScoreCommand;
|
||||
import de.lunarakai.minecleaner.commands.HelpCommand;
|
||||
import de.lunarakai.minecleaner.commands.InfoCommand;
|
||||
import de.lunarakai.minecleaner.commands.ListCommand;
|
||||
import de.lunarakai.minecleaner.commands.ListPlayersInArenaCommand;
|
||||
|
|
@ -22,7 +23,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||
import de.iani.cubesidestats.api.CubesideStatisticsAPI;
|
||||
import de.iani.cubesideutils.bukkit.commands.CommandRouter;
|
||||
import de.iani.playerUUIDCache.PlayerUUIDCache;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
|
|
@ -81,6 +81,7 @@ public final class MinecleanerPlugin extends JavaPlugin {
|
|||
minecleanerCommand.addCommandMapping(new ListCommand(this), "list");
|
||||
minecleanerCommand.addCommandMapping(new InfoCommand(this), "info");
|
||||
minecleanerCommand.addCommandMapping(new ListPlayersInArenaCommand(this), "currentplayers");
|
||||
minecleanerCommand.addCommandMapping(new HelpCommand(this), "help");
|
||||
|
||||
// Groups
|
||||
minecleanerCommand.addCommandMapping(new InviteCommand(this), "invite");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package de.lunarakai.minecleaner.commands;
|
||||
|
||||
import de.iani.cubesideutils.bukkit.commands.SubCommand;
|
||||
import de.iani.cubesideutils.bukkit.commands.exceptions.DisallowsCommandBlockException;
|
||||
import de.iani.cubesideutils.bukkit.commands.exceptions.IllegalSyntaxException;
|
||||
import de.iani.cubesideutils.bukkit.commands.exceptions.InternalCommandException;
|
||||
import de.iani.cubesideutils.bukkit.commands.exceptions.NoPermissionException;
|
||||
import de.iani.cubesideutils.bukkit.commands.exceptions.RequiresPlayerException;
|
||||
import de.iani.cubesideutils.commands.ArgsParser;
|
||||
import de.lunarakai.minecleaner.MinecleanerPlugin;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class HelpCommand extends SubCommand {
|
||||
MinecleanerPlugin plugin;
|
||||
|
||||
public HelpCommand(MinecleanerPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsage() {
|
||||
return "[(empty)|group]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresPlayer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequiredPermission() {
|
||||
return MinecleanerPlugin.PERMISSION_PLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String commandString, ArgsParser args) throws DisallowsCommandBlockException, RequiresPlayerException, NoPermissionException, IllegalSyntaxException, InternalCommandException {
|
||||
Player player = (Player) commandSender;
|
||||
|
||||
String subMenu = "";
|
||||
if(args.remaining() == 1) {
|
||||
subMenu = args.getNext().toLowerCase().trim();
|
||||
}
|
||||
|
||||
if(subMenu.equals("group")) {
|
||||
showHelpGroup(player);
|
||||
return true;
|
||||
} else {
|
||||
showGeneralHelp(player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGeneralHelp(Player player) {
|
||||
player.sendMessage(Component.text("--- " + plugin.getDisplayedPluginName() + " Help ---", NamedTextColor.AQUA)
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... info: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Allgemeine Auskunft zum Plugin", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... stats [playername]: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Zeigt dir entweder deine eigenen Stats (leer lassen) oder die Stats anderer Spieler an", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... settings: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Öffnet ein Menü in dem du Veränderungen an deinen eigenen Einstellungen für " + plugin.getDisplayedPluginName() + " vornehmen kannst", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... help [group]: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Zeigt dieses Menü (frei lassen) oder die Hilfe für Gruppen an (group)", NamedTextColor.GREEN)));
|
||||
}
|
||||
|
||||
private void showHelpGroup(Player player) {
|
||||
player.sendMessage(Component.text("--- " + plugin.getDisplayedPluginName() + " Group Help ---", NamedTextColor.AQUA)
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... invite <playername>: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Lädt andere Spieler zu deiner " + plugin.getDisplayedPluginName() + " Gruppe ein", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... accept | deny: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Nehme eine erhaltene Einladung an (accept), oder lehne sie ab (deny)", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... dismantlegroup: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Löst die Gruppe, die du erstellt hast, auf", NamedTextColor.GREEN))
|
||||
.append(Component.newline())
|
||||
.append(Component.text(" /... groupmembers: ", NamedTextColor.BLUE))
|
||||
.append(Component.text("Listet die Mitglieder deiner Gruppe auf", NamedTextColor.GREEN)));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue