From 258fa8e21c060c40a68e6a092911a3ee0cafbdf3 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 26 Feb 2011 19:31:13 +0000 Subject: [PATCH] Added PlayerChatEvent.getRecipients By: Dinnerbone --- .../org/bukkit/event/player/PlayerChatEvent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java index a4de140771..5d605c3ca0 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerChatEvent.java @@ -1,6 +1,9 @@ package org.bukkit.event.player; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; @@ -11,10 +14,13 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { private boolean cancel = false; private String message; private String format = "<%1$s> %2$s"; + private final Set recipients; public PlayerChatEvent(final Type type, final Player player, final String message) { super(type, player); this.message = message; + + recipients = new HashSet(Arrays.asList(player.getServer().getOnlinePlayers())); } /** @@ -90,4 +96,13 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { this.format = format; } + + /** + * Gets a set of recipients that this chat message will be displayed to + * + * @return All Players who will see this chat message + */ + public Set getRecipients() { + return recipients; + } }