Add more component name methods (#6578)
This commit is contained in:
@@ -1266,12 +1266,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// Spigot end
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the name of this command sender
|
||||
+ *
|
||||
+ * @return Name of the sender
|
||||
+ */
|
||||
+ public @NotNull Component name();
|
||||
+
|
||||
+ @Override
|
||||
+ default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
||||
+ this.sendMessage(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(message));
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/command/MessageCommandSender.java
|
||||
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
|
||||
@@ -0,0 +0,0 @@ public interface MessageCommandSender extends CommandSender {
|
||||
default String getName() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
|
||||
+ throw new NotImplementedException();
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
@Override
|
||||
default boolean isOp() {
|
||||
diff --git a/src/main/java/org/bukkit/command/ProxiedCommandSender.java b/src/main/java/org/bukkit/command/ProxiedCommandSender.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/command/ProxiedCommandSender.java
|
||||
@@ -1361,6 +1385,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// Spigot end
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the entity's display name formatted with their team prefix/suffix and
|
||||
+ * the entity's default hover/click events.
|
||||
+ *
|
||||
+ * @return the team display name
|
||||
+ */
|
||||
+ @NotNull net.kyori.adventure.text.Component teamDisplayName();
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
|
||||
|
||||
Reference in New Issue
Block a user