PaperMC/CraftBukkit-Patches/0082-Add-support-for-fetching-hidden-players.patch

32 lines
1 KiB
Diff

From 673a0dcfb5c95fbe1513a8e0e71d034ab6f153aa Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Sun, 9 Feb 2014 14:03:03 -0500
Subject: [PATCH] Add support for fetching hidden players
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 29c73f0..b560f77 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1434,6 +1434,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{
return getHandle().locale;
}
+
+ @Override
+ public Set<Player> getHiddenPlayers()
+ {
+ Set<Player> ret = new HashSet<Player>();
+ for ( UUID u : hiddenPlayers )
+ {
+ ret.add( getServer().getPlayer( u ) );
+ }
+
+ return java.util.Collections.unmodifiableSet( ret );
+ }
};
public Player.Spigot spigot()
--
2.1.4