mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 20:43:11 +00:00
Optimize player / user iteration.
* Add a method for backwards compatability with unmapped code. * Convert all getOnlinePlayers() calls to use this method, part of the IEssentials interface * Add a new method getOnlineUsers() Ljava/lang/Iterable; * Convert appropriate calls to use this method * Update Bukkit to #1945 * Update CraftBukkit to #3103
This commit is contained in:
parent
ed56afda26
commit
465041b98b
27 changed files with 126 additions and 63 deletions
|
@ -623,9 +623,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
|
|||
this.getBase().kickPlayer(kickReason);
|
||||
|
||||
|
||||
for (Player player : ess.getServer().getOnlinePlayers())
|
||||
for (User user : ess.getOnlineUsers())
|
||||
{
|
||||
final User user = ess.getUser(player);
|
||||
if (user.isAuthorized("essentials.kick.notify"))
|
||||
{
|
||||
user.sendMessage(tl("playerKicked", Console.NAME, getName(), kickReason));
|
||||
|
@ -765,11 +764,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
|
|||
vanished = set;
|
||||
if (set)
|
||||
{
|
||||
for (Player p : ess.getServer().getOnlinePlayers())
|
||||
for (User user : ess.getOnlineUsers())
|
||||
{
|
||||
if (!ess.getUser(p).isAuthorized("essentials.vanish.see"))
|
||||
if (!user.isAuthorized("essentials.vanish.see"))
|
||||
{
|
||||
p.hidePlayer(getBase());
|
||||
user.getBase().hidePlayer(getBase());
|
||||
}
|
||||
}
|
||||
setHidden(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue