Skip to content

Commit d11a295

Browse files
committed
Merge branch '2.x' of github.com:essentials/Essentials into 2.x
2 parents ffea359 + 037456c commit d11a295

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

Essentials/src/com/earth2me/essentials/Essentials.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,8 @@ private void registerListeners(PluginManager pm)
325325
@Override
326326
public void onDisable()
327327
{
328-
for (Player p : getServer().getOnlinePlayers())
328+
for (User user : getOnlineUsers())
329329
{
330-
User user = getUser(p);
331330
if (user.isVanished())
332331
{
333332
user.setVanished(false);
@@ -562,9 +561,8 @@ else if (user == null)
562561

563562
public void cleanupOpenInventories()
564563
{
565-
for (Player player : getServer().getOnlinePlayers())
564+
for (User user : getOnlineUsers())
566565
{
567-
User user = getUser(player);
568566
if (user.isRecipeSee())
569567
{
570568
user.getBase().getOpenInventory().getTopInventory().clear();
@@ -742,7 +740,7 @@ public void onPlayerJoin(final PlayerJoinEvent event)
742740
event.getPlayer().sendMessage("Essentials failed to load, read the log file.");
743741
}
744742
}, this);
745-
for (Player player : getServer().getOnlinePlayers())
743+
for (Player player : getOnlinePlayers())
746744
{
747745
player.sendMessage("Essentials failed to load, read the log file.");
748746
}

Essentials/src/com/earth2me/essentials/User.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ public void setVanished(final boolean set)
780780
}
781781
else
782782
{
783-
for (Player p : ess.getServer().getOnlinePlayers())
783+
for (Player p : ess.getOnlinePlayers())
784784
{
785785
p.showPlayer(getBase());
786786
}

Essentials/src/com/earth2me/essentials/commands/Commandnear.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ private String getLocal(final Server server, final User user, final long radius)
103103
final long radiusSquared = radius * radius;
104104
boolean showHidden = user.canInteractVanished();
105105

106-
for (Player onlinePlayer : server.getOnlinePlayers())
106+
for (User player: ess.getOnlineUsers())
107107
{
108-
final User player = ess.getUser(onlinePlayer);
109-
if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(onlinePlayer)))
108+
if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase())))
110109
{
111110
final Location playerLoc = player.getLocation();
112111
if (playerLoc.getWorld() != world)

Essentials/src/com/earth2me/essentials/commands/Commandptime.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ private Set<User> getUsers(final Server server, final CommandSource sender, fina
220220
// If that fails, Is the argument something like "*" or "all"?
221221
else if (selector.equalsIgnoreCase("*") || selector.equalsIgnoreCase("all"))
222222
{
223-
for (Player player : server.getOnlinePlayers())
223+
for (User u : ess.getOnlineUsers())
224224
{
225-
users.add(ess.getUser(player));
225+
users.add(u);
226226
}
227227
}
228228
// We failed to understand the world target...

Essentials/src/com/earth2me/essentials/commands/Commandpweather.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ private Set<User> getUsers(final Server server, final CommandSource sender, fina
170170
// If that fails, Is the argument something like "*" or "all"?
171171
else if (selector.equalsIgnoreCase("*") || selector.equalsIgnoreCase("all"))
172172
{
173-
for (Player player : server.getOnlinePlayers())
173+
for (User u : ess.getOnlineUsers())
174174
{
175-
users.add(ess.getUser(player));
175+
users.add(u);
176176
}
177177
}
178178
// We failed to understand the world target...

Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ else if (validKeyword.getType().equals(KeywordCachable.SUBVALUE))
222222

223223
//Now lets build the all user playerlist
224224
final StringBuilder playerlistBuilder = new StringBuilder();
225-
for (Player p : ess.getServer().getOnlinePlayers())
225+
for (Player p : ess.getOnlinePlayers())
226226
{
227227
if (ess.getUser(p).isHidden())
228228
{

0 commit comments

Comments
 (0)