Add component methods to TextDisplay entity

This commit is contained in:
Jake Potrebic 2023-03-14 16:52:28 -07:00
parent 94604b6474
commit c225146bc9
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5
2 changed files with 64 additions and 0 deletions

View file

@ -2498,6 +2498,48 @@ index c60e1fc1cad1b9889a508602df84840723b7b966..baf0887ec941533f8007f2c7f7ab78f1
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/entity/TextDisplay.java b/src/main/java/org/bukkit/entity/TextDisplay.java
index 766d6f001d4bc59cbe13d67f539bcae3fce67144..b12cb420f919aeafa8e41356f129f82a8e676505 100644
--- a/src/main/java/org/bukkit/entity/TextDisplay.java
+++ b/src/main/java/org/bukkit/entity/TextDisplay.java
@@ -13,17 +13,37 @@ public interface TextDisplay extends Display {
* Gets the displayed text.
*
* @return the displayed text.
+ * @deprecated in favour of {@link #text()}
*/
@Nullable
+ @Deprecated // Paper
String getText();
/**
* Sets the displayed text.
*
* @param text the new text
+ * @deprecated in favour of {@link #text(net.kyori.adventure.text.Component)}
*/
+ @Deprecated // Paper
void setText(@Nullable String text);
+ // Paper start
+ /**
+ * Gets the displayed text.
+ *
+ * @return the displayed text
+ */
+ net.kyori.adventure.text.Component text();
+
+ /**
+ * Sets the displayed text.
+ *
+ * @param text the new text
+ */
+ void text(@Nullable net.kyori.adventure.text.Component text);
+ // Paper end
+
/**
* Gets the maximum line width before wrapping.
*
diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
index 63c80b4ee1f7adc8a9efc3b607993104b1991f90..91cab8b13d5bba34007f124838b32a1df58c5ac7 100644
--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java