mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Update bungeecord chat API graduations
This commit is contained in:
parent
e3e56baeea
commit
567224a84c
4 changed files with 19 additions and 14 deletions
|
@ -84,6 +84,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ * @param components the components to send
|
||||
+ */
|
||||
+ public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components);
|
||||
+
|
||||
+ /**
|
||||
+ * Sends an array of components as a single message to the specified screen position of this player
|
||||
+ *
|
||||
+ * @param position the screen position
|
||||
+ * @param components the components to send
|
||||
+ */
|
||||
+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
|
|
|
@ -383,7 +383,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param components the components to send
|
||||
*/
|
||||
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components);
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components);
|
||||
+
|
||||
+ /**
|
||||
+ * Set the text displayed in the player list header and footer for this player
|
||||
|
|
|
@ -15,16 +15,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper start
|
||||
+ @Override
|
||||
+ public void broadcast(BaseComponent component) {
|
||||
+ for (Player player : getOnlinePlayers()) {
|
||||
+ player.sendMessage(component);
|
||||
+ }
|
||||
+ this.spigot.broadcast(component);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void broadcast(BaseComponent... components) {
|
||||
+ for (Player player : getOnlinePlayers()) {
|
||||
+ player.sendMessage(components);
|
||||
+ }
|
||||
+ this.spigot.broadcast(components);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
|
@ -42,16 +38,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper start
|
||||
+ @Override
|
||||
+ public void sendMessage(BaseComponent component) {
|
||||
+ sendMessage(new BaseComponent[]{component});
|
||||
+ this.spigot.sendMessage(component);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendMessage(BaseComponent... components) {
|
||||
+ if (getHandle().playerConnection == null) return;
|
||||
+ this.spigot.sendMessage(components);
|
||||
+ }
|
||||
+
|
||||
+ PacketPlayOutChat packet = new PacketPlayOutChat();
|
||||
+ packet.components = components;
|
||||
+ getHandle().playerConnection.sendPacket(packet);
|
||||
+ @Override
|
||||
+ public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent... components) {
|
||||
+ this.spigot.sendMessage(position, components);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
|
|
|
@ -89,8 +89,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
packet.components = components;
|
||||
getHandle().playerConnection.sendPacket(packet);
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent... components) {
|
||||
this.spigot.sendMessage(position, components);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
Loading…
Reference in a new issue