mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Internal changes handling chat components
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 23e252797baf42ef1d3b165dc6896e4a6595d3bc Mon Sep 17 00:00:00 2001
|
||||
From 33362dcb20d112ca6872c2da530d27a7f7ad36ff 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
|
||||
@@ -77,7 +77,7 @@ index 0b23a0548d..ab0cf8b561 100644
|
||||
throw CommandListenerWrapper.a.create();
|
||||
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
|
||||
index 0000000000..f85290888c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/command/PingCommand.java
|
||||
@@ -0,0 +1,34 @@
|
||||
@@ -86,10 +86,10 @@ index 0000000000..3aea2a76db
|
||||
+
|
||||
+import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
+import net.minecraft.server.ArgumentEntity;
|
||||
+import net.minecraft.server.ChatMessage;
|
||||
+import net.minecraft.server.CommandDispatcher;
|
||||
+import net.minecraft.server.CommandListenerWrapper;
|
||||
+import net.minecraft.server.EntityPlayer;
|
||||
+import net.minecraft.server.LocaleLanguage;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
@@ -110,7 +110,7 @@ index 0000000000..3aea2a76db
|
||||
+
|
||||
+ private static int execute(CommandListenerWrapper sender, Collection<EntityPlayer> targets) throws CommandSyntaxException {
|
||||
+ for (EntityPlayer player : targets) {
|
||||
+ sender.sendMessage(new ChatMessage("commands.purpur.ping", player.getScoreboardDisplayName(), player.ping), false);
|
||||
+ sender.sendMessage(LocaleLanguage.translate("commands.purpur.ping", player.getScoreboardDisplayName(), player.ping), false);
|
||||
+ }
|
||||
+ return targets.size();
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user