mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Update /mspt command to brigadier and lang asset
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 0fa2b2131a54e8622238ab538933a0454a27b4d4 Mon Sep 17 00:00:00 2001
|
||||
From ca4d608c6e987a44f467fae90f5bf036763ad3a4 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 13 Mar 2020 22:29:10 -0500
|
||||
Subject: [PATCH] Add /ping command
|
||||
@@ -7,10 +7,9 @@ Subject: [PATCH] Add /ping command
|
||||
.../net/minecraft/server/ArgumentEntity.java | 2 ++
|
||||
.../minecraft/server/CommandDispatcher.java | 5 ++-
|
||||
.../server/CommandListenerWrapper.java | 1 +
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 1 +
|
||||
.../net/pl3x/purpur/command/PingCommand.java | 34 +++++++++++++++++++
|
||||
.../assets/minecraft/lang/en_us.json | 1 +
|
||||
6 files changed, 43 insertions(+), 1 deletion(-)
|
||||
5 files changed, 42 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/command/PingCommand.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ArgumentEntity.java b/src/main/java/net/minecraft/server/ArgumentEntity.java
|
||||
@@ -31,7 +30,7 @@ index 39a6a9ac00..5568649b7e 100644
|
||||
List<EntityPlayer> list = ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource());
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
index 37b1a7947c..b38a5223cb 100644
|
||||
index c9d1f94100..3b15f953bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
@@ -30,7 +30,7 @@ import org.bukkit.event.server.ServerCommandEvent;
|
||||
@@ -43,15 +42,15 @@ index 37b1a7947c..b38a5223cb 100644
|
||||
|
||||
// CraftBukkit start
|
||||
public final CommandDispatcher init(boolean flag) {
|
||||
@@ -106,6 +106,7 @@ public class CommandDispatcher {
|
||||
CommandIdleTimeout.a(this.b);
|
||||
@@ -107,6 +107,7 @@ public class CommandDispatcher {
|
||||
CommandStop.a(this.b);
|
||||
CommandWhitelist.a(this.b);
|
||||
net.pl3x.purpur.command.MSPTCommand.register(getDispatcher()); // Purpur
|
||||
+ net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur
|
||||
}
|
||||
|
||||
this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
|
||||
@@ -315,10 +316,12 @@ public class CommandDispatcher {
|
||||
@@ -316,10 +317,12 @@ public class CommandDispatcher {
|
||||
|
||||
}
|
||||
|
||||
@@ -76,18 +75,6 @@ index 0b23a0548d..ab0cf8b561 100644
|
||||
public EntityPlayer h() throws CommandSyntaxException {
|
||||
if (!(this.k instanceof EntityPlayer)) {
|
||||
throw CommandListenerWrapper.a.create();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 63a91e7b7a..f9f83e5b9a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -3,6 +3,7 @@ package net.pl3x.purpur;
|
||||
import com.google.common.base.Throwables;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.pl3x.purpur.command.MSPTCommand;
|
||||
+import net.pl3x.purpur.command.PingCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/command/PingCommand.java b/src/main/java/net/pl3x/purpur/command/PingCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000..3aea2a76db
|
||||
@@ -129,13 +116,13 @@ index 0000000000..3aea2a76db
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/resources/assets/minecraft/lang/en_us.json b/src/main/resources/assets/minecraft/lang/en_us.json
|
||||
index ae0b45fe41..2d7d38d2fb 100644
|
||||
index 09816cedfc..e6b0c86b03 100644
|
||||
--- a/src/main/resources/assets/minecraft/lang/en_us.json
|
||||
+++ b/src/main/resources/assets/minecraft/lang/en_us.json
|
||||
@@ -4071,6 +4071,7 @@
|
||||
"commands.spectate.success.started": "Now spectating %s",
|
||||
"commands.spectate.not_spectator": "%s is not in spectator mode",
|
||||
@@ -4073,6 +4073,7 @@
|
||||
"commands.spectate.self": "Cannot spectate yourself",
|
||||
"commands.purpur.mspt": "§6Server tick times §e(§7avg§e/§7min§e/§7max§e)§6 from last 5s§7,§6 10s§7,§6 1m§e:",
|
||||
"commands.purpur.mspt.times": "§6◴ %s§7/%s§7/%s§e, %s§7/%s§7/%s§e, %s§7/%s§7/%s",
|
||||
+ "commands.purpur.ping": "§a%s's ping is %sms",
|
||||
"argument.range.empty": "Expected value or range of values",
|
||||
"argument.range.ints": "Only whole numbers allowed, not decimals",
|
||||
|
||||
Reference in New Issue
Block a user