#556: Allow sending messages from specific UUIDs

By: Mariell Hoversholm <proximyst@proximyst.com>
This commit is contained in:
Bukkit/Spigot 2020-10-17 17:42:40 +11:00
parent 73f42f8bd4
commit f341d8d29a
3 changed files with 36 additions and 0 deletions

View File

@ -1,8 +1,10 @@
package org.bukkit.command;
import java.util.UUID;
import org.bukkit.Server;
import org.bukkit.permissions.Permissible;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface CommandSender extends Permissible {
@ -20,6 +22,22 @@ public interface CommandSender extends Permissible {
*/
public void sendMessage(@NotNull String[] messages);
/**
* Sends this sender a message
*
* @param message Message to be displayed
* @param sender The sender of this message
*/
public void sendMessage(@Nullable UUID sender, @NotNull String message);
/**
* Sends this sender multiple messages
*
* @param messages An array of messages to be displayed
* @param sender The sender of this message
*/
public void sendMessage(@Nullable UUID sender, @NotNull String[] messages);
/**
* Returns the server instance that this command is running on
*

View File

@ -1,6 +1,8 @@
package org.bukkit.conversations;
import java.util.UUID;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* The Conversable interface is used to indicate objects that can have
@ -54,4 +56,12 @@ public interface Conversable {
* @param message Message to be displayed
*/
public void sendRawMessage(@NotNull String message);
/**
* Sends this sender a message raw
*
* @param message Message to be displayed
* @param sender The sender of this message
*/
public void sendRawMessage(@Nullable UUID sender, @NotNull String message);
}

View File

@ -1,11 +1,14 @@
package org.bukkit.conversations;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Server;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
*/
@ -48,6 +51,11 @@ public class FakeConversable implements Conversable {
lastSentMessage = message;
}
@Override
public void sendRawMessage(@Nullable UUID sender, @NotNull String message) {
this.sendRawMessage(message);
}
public Server getServer() {
return null;
}