Skip to content

Commit

Permalink
Merge branch '2.x' of github.com:essentials/Essentials into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
khobbits committed Sep 2, 2014
2 parents ffea359 + 037456c commit d11a295
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
8 changes: 3 additions & 5 deletions Essentials/src/com/earth2me/essentials/Essentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,8 @@ private void registerListeners(PluginManager pm)
@Override
public void onDisable()
{
for (Player p : getServer().getOnlinePlayers())
for (User user : getOnlineUsers())
{
User user = getUser(p);
if (user.isVanished())
{
user.setVanished(false);
Expand Down Expand Up @@ -562,9 +561,8 @@ else if (user == null)

public void cleanupOpenInventories()
{
for (Player player : getServer().getOnlinePlayers())
for (User user : getOnlineUsers())
{
User user = getUser(player);
if (user.isRecipeSee())
{
user.getBase().getOpenInventory().getTopInventory().clear();
Expand Down Expand Up @@ -742,7 +740,7 @@ public void onPlayerJoin(final PlayerJoinEvent event)
event.getPlayer().sendMessage("Essentials failed to load, read the log file.");
}
}, this);
for (Player player : getServer().getOnlinePlayers())
for (Player player : getOnlinePlayers())
{
player.sendMessage("Essentials failed to load, read the log file.");
}
Expand Down
2 changes: 1 addition & 1 deletion Essentials/src/com/earth2me/essentials/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ public void setVanished(final boolean set)
}
else
{
for (Player p : ess.getServer().getOnlinePlayers())
for (Player p : ess.getOnlinePlayers())
{
p.showPlayer(getBase());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ private String getLocal(final Server server, final User user, final long radius)
final long radiusSquared = radius * radius;
boolean showHidden = user.canInteractVanished();

for (Player onlinePlayer : server.getOnlinePlayers())
for (User player: ess.getOnlineUsers())
{
final User player = ess.getUser(onlinePlayer);
if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(onlinePlayer)))
if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase())))
{
final Location playerLoc = player.getLocation();
if (playerLoc.getWorld() != world)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ private Set<User> getUsers(final Server server, final CommandSource sender, fina
// If that fails, Is the argument something like "*" or "all"?
else if (selector.equalsIgnoreCase("*") || selector.equalsIgnoreCase("all"))
{
for (Player player : server.getOnlinePlayers())
for (User u : ess.getOnlineUsers())
{
users.add(ess.getUser(player));
users.add(u);
}
}
// We failed to understand the world target...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ private Set<User> getUsers(final Server server, final CommandSource sender, fina
// If that fails, Is the argument something like "*" or "all"?
else if (selector.equalsIgnoreCase("*") || selector.equalsIgnoreCase("all"))
{
for (Player player : server.getOnlinePlayers())
for (User u : ess.getOnlineUsers())
{
users.add(ess.getUser(player));
users.add(u);
}
}
// We failed to understand the world target...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ else if (validKeyword.getType().equals(KeywordCachable.SUBVALUE))

//Now lets build the all user playerlist
final StringBuilder playerlistBuilder = new StringBuilder();
for (Player p : ess.getServer().getOnlinePlayers())
for (Player p : ess.getOnlinePlayers())
{
if (ess.getUser(p).isHidden())
{
Expand Down

0 comments on commit d11a295

Please sign in to comment.