1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-24 07:13:17 +02: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:
md_5
2014-07-12 16:03:36 +10:00
committed by KHobbits
parent 310e41396b
commit 035182fcda
25 changed files with 126 additions and 63 deletions

View File

@@ -149,4 +149,10 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
// Ignore exceptions
}
}
@Override
public IEssentials getEss()
{
return ess;
}
}

View File

@@ -1,5 +1,6 @@
package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.IEssentials;
import net.ess3.api.IUser;
import java.util.List;
import org.bukkit.entity.Player;
@@ -25,4 +26,6 @@ public interface IEssentialsXMPP extends Plugin
boolean toggleSpy(final Player user);
void broadcastMessage(final IUser sender, final String message, final String xmppAddress);
IEssentials getEss();
}

View File

@@ -163,7 +163,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
final int usercount;
final StringBuilder stringBuilder = new StringBuilder();
usercount = parent.getServer().getOnlinePlayers().length;
usercount = parent.getEss().getOnlinePlayers().size();
if (usercount == 0)
{