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:
parent
5ffeb70186
commit
e294802977
11 changed files with 1035 additions and 772 deletions
|
@ -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..874f0c2a071994c2145848886caa385e0e0bfb9b
|
||||
index 0000000000000000000000000000000000000000..8b5293b0c696ef21d0101493ffa41b60bf0bc86b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MSPTCommand.java
|
||||
@@ -0,0 +1,99 @@
|
||||
+package com.destroystokyo.paper;
|
||||
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
@@ -0,0 +1,102 @@
|
||||
+package io.papermc.paper.command;
|
||||
+
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
|
@ -23,6 +23,8 @@ index 0000000000000000000000000000000000000000..874f0c2a071994c2145848886caa385e
|
|||
+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..874f0c2a071994c2145848886caa385e
|
|||
+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";
|
||||
|
@ -110,17 +113,10 @@ index 0000000000000000000000000000000000000000..874f0c2a071994c2145848886caa385e
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/command/PaperCommands.java b/src/main/java/io/papermc/paper/command/PaperCommands.java
|
||||
index 82bce89dc174c8c4a4ab8efeffaaf22ddeb377fb..37d28625b9528bbe0cd6d9623e702bbbc2b07883 100644
|
||||
index 6a00f3d38da8107825ab1d405f337fd077b09f72..d31b5ed47cffc61c90c926a0cd2005b72ebddfc5 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/PaperCommands.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/PaperCommands.java
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -15,6 +16,7 @@ public final class PaperCommands {
|
||||
@@ -17,6 +17,7 @@ public final class PaperCommands {
|
||||
private static final Map<String, Command> COMMANDS = new HashMap<>();
|
||||
static {
|
||||
COMMANDS.put("paper", new PaperCommand("paper"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue