Skip to content

Commit 8a4ee06

Browse files
committed
made server-info command info command
1 parent faa2e52 commit 8a4ee06

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

PlayerLevels-Core/src/main/java/net/jandie1505/playerlevels/core/commands/subcommands/DebugSubcommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public DebugSubcommand(@NotNull PlayerLevels plugin) {
1818
this.addSubcommand("config", SubcommandEntry.of(new DebugConfigSubcommand(this.plugin)));
1919
this.addSubcommand("messages", SubcommandEntry.of(new DebugMessagesSubcommand(this.plugin)));
2020
this.addSubcommand("database", SubcommandEntry.of(new DebugDatabaseSubcommand(this.plugin)));
21-
this.addSubcommand("server-info", SubcommandEntry.of(new DebugServerInfoSubcommand(this.plugin)));
21+
this.addSubcommand("info", SubcommandEntry.of(new DebugInfoSubcommand(this.plugin)));
2222
this.addSubcommand("reload", SubcommandEntry.of(new DebugReloadSubcommand(this.plugin)));
2323
}
2424

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
import java.util.List;
1313

14-
public class DebugServerInfoSubcommand implements TabCompletingCommandExecutor {
14+
public class DebugInfoSubcommand implements TabCompletingCommandExecutor {
1515
@NotNull private final PlayerLevels plugin;
1616

17-
public DebugServerInfoSubcommand(@NotNull PlayerLevels plugin) {
17+
public DebugInfoSubcommand(@NotNull PlayerLevels plugin) {
1818
this.plugin = plugin;
1919
}
2020

@@ -26,6 +26,10 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
2626
return true;
2727
}
2828

29+
sender.sendRichMessage(this.plugin.getPluginMeta().getName());
30+
sender.sendRichMessage("<gray>Version: " + this.plugin.getPluginMeta().getVersion());
31+
sender.sendRichMessage("<gray>Authors: " + this.plugin.getPluginMeta().getAuthors());
32+
sender.sendRichMessage("<gray>Website: " + this.plugin.getPluginMeta().getWebsite());
2933
sender.sendRichMessage("<gray>Server ID: " + this.plugin.getServerId());
3034

3135
return true;

docs/javadoc/net/jandie1505/playerlevels/core/commands/subcommands/debug/DebugServerInfoSubcommand.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<h1 title="Klasse DebugServerInfoSubcommand" class="title">Klasse DebugServerInfoSubcommand</h1>
8888
</div>
8989
<div class="inheritance" title="Vererbungsbaum"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="Klasse oder Schnittstelle in java.lang" class="external-link">java.lang.Object</a>
90-
<div class="inheritance">net.jandie1505.playerlevels.core.commands.subcommands.debug.DebugServerInfoSubcommand</div>
90+
<div class="inheritance">net.jandie1505.playerlevels.core.commands.subcommands.debug.DebugInfoSubcommand</div>
9191
</div>
9292
<section class="class-description" id="class-description">
9393
<dl class="notes">

documentation/docs/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This is the full command structure of the plugin:
2929
- `config` (change config values)
3030
- `database` (manage database connection)
3131
- `messages` (change message values)
32-
- `server-info` (get server information)
32+
- `info` (get plugin information)
3333
- `reload` (reload config/messages)
3434

3535
As you can see, this is a huge number of commands. But you most likely only need a small amount of them.
@@ -91,7 +91,7 @@ These commands are for debugging purposes:
9191
| Manage database connection: | `/levels debug database (connect\|disconnect\|info)` |
9292
| Modify messages config: | `/levels debug messages (list [section]\|get <key>\|set <key> <type> <value>)` |
9393
| Reload config from files: | `/levels debug reload (config\|messages> [--clear=(true\|false)\|--merge-defaults=(true\|false)]` |
94-
| View server info: | `/levels debug server-info` |
94+
| View plugin info: | `/levels debug info` |
9595

9696
The permission of those commands is `playerlevels.debug`.
9797
Don't use them if you don't know what you're doing.

0 commit comments

Comments
 (0)