Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69b7ea1
commit 655af9a
Showing
219 changed files
with
169 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
patches/server/0004-Component-related-conveniences.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: William Blake Galbreath <blake.galbreath@gmail.com> | ||
Date: Tue, 29 Jun 2021 21:37:40 -0500 | ||
Subject: [PATCH] Component related conveniences | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java | ||
index 570cea8ee6a442b2dc3c6ef849294ef0c02027ca..5a344f68176bc9dcc31a1d75ada2afa5f1f3b8ce 100644 | ||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java | ||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java | ||
@@ -1389,6 +1389,62 @@ public abstract class PlayerList { | ||
} | ||
// CraftBukkit end | ||
|
||
+ // Purpur start | ||
+ public void sendMessage(@Nullable String message) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable String message, ChatType type) { | ||
+ sendMessage(message, type, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable String message, UUID sender) { | ||
+ sendMessage(message, ChatType.SYSTEM, sender); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable String message, ChatType type, UUID sender) { | ||
+ if (message != null) { | ||
+ sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.get().parse(message), type, sender); | ||
+ } | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message, ChatType type) { | ||
+ sendMessage(message, type, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message, UUID sender) { | ||
+ sendMessage(message, ChatType.SYSTEM, sender); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message, ChatType type, UUID sender) { | ||
+ if (message != null) { | ||
+ sendMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), type, sender); | ||
+ } | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable Component message) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable Component message, ChatType type) { | ||
+ sendMessage(message, type, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable Component message, UUID sender) { | ||
+ sendMessage(message, ChatType.SYSTEM, sender); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable Component message, ChatType type, UUID sender) { | ||
+ if (message != null) { | ||
+ broadcastMessage(message, type, sender); | ||
+ } | ||
+ } | ||
+ // Purpur end | ||
+ | ||
public void broadcastMessage(Component message, ChatType type, UUID sender) { | ||
this.server.sendMessage(message, sender); | ||
Iterator iterator = this.players.iterator(); | ||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java | ||
index ca7718053a6a2eb715ea3671bd4bc15304ede420..19d716a7350c6ed5b912064aa1e63a1fbbe4183f 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/Entity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java | ||
@@ -3565,6 +3565,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n | ||
return SlotAccess.NULL; | ||
} | ||
|
||
+ // Purpur Start | ||
+ public void sendMessage(@Nullable String message) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable String message, UUID sender) { | ||
+ if (message != null) { | ||
+ sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.get().parse(message), sender); | ||
+ } | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message, UUID sender) { | ||
+ if (message != null) { | ||
+ sendMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), sender); | ||
+ } | ||
+ } | ||
+ | ||
+ public void sendMessage(@Nullable Component message) { | ||
+ if (message != null) { | ||
+ sendMessage(message, Util.NIL_UUID); | ||
+ } | ||
+ } | ||
+ // Purpur end | ||
+ | ||
@Override | ||
public void sendMessage(Component message, UUID sender) {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.