Refactor paper command (#8112)

* Refactor paper command

* Improve paper dumpitem output

* Register paper command permissions

Would be nice to add descriptions for these too, but that's an enhancement for another time

* Update MobcapsCommandTest fail message

* Notify on bad radius for fix light

* fixup rebase
This commit is contained in:
Jason Penilla
2022-07-08 16:01:42 -07:00
parent 21e92425e9
commit 35eca19853
11 changed files with 1016 additions and 753 deletions

View File

@@ -4,13 +4,13 @@ Date: Sun, 5 Apr 2020 22:23:14 -0500
Subject: [PATCH] Add tick times API and /mspt command
diff --git a/src/main/java/com/destroystokyo/paper/MSPTCommand.java b/src/main/java/com/destroystokyo/paper/MSPTCommand.java
diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/MSPTCommand.java
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
@@ -0,0 +0,0 @@
+package com.destroystokyo.paper;
+package io.papermc.paper.command;
+
+import net.kyori.adventure.text.Component;
+import net.minecraft.server.MinecraftServer;
@@ -23,6 +23,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.framework.qual.DefaultQualifier;
+
+import static net.kyori.adventure.text.Component.text;
+import static net.kyori.adventure.text.format.NamedTextColor.GOLD;
@@ -31,11 +33,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import static net.kyori.adventure.text.format.NamedTextColor.RED;
+import static net.kyori.adventure.text.format.NamedTextColor.YELLOW;
+
+public class MSPTCommand extends Command {
+@DefaultQualifier(NonNull.class)
+public final class MSPTCommand extends Command {
+ private static final DecimalFormat DF = new DecimalFormat("########0.0");
+ private static final Component SLASH = text("/");
+
+ public MSPTCommand(String name) {
+ public MSPTCommand(final String name) {
+ super(name);
+ this.description = "View server tick times";
+ this.usageMessage = "/mspt";
@@ -113,13 +116,6 @@ diff --git a/src/main/java/io/papermc/paper/command/PaperCommands.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommands.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommands.java
@@ -0,0 +0,0 @@
package io.papermc.paper.command;
+import com.destroystokyo.paper.MSPTCommand;
import com.destroystokyo.paper.PaperCommand;
import net.minecraft.server.MinecraftServer;
import org.bukkit.command.Command;
@@ -0,0 +0,0 @@ public final class PaperCommands {
private static final Map<String, Command> COMMANDS = new HashMap<>();
static {