Merge pull request #13 from UnioDex/master

Fixed safe_online method.
This commit is contained in:
Ryan authored and GitHub committed 2019-05-09 07:07:32 -04:00
commit 1d7c30475a
1 file changed
+7 -1
@@ -196,7 +196,13 @@ public class EssentialsExpansion extends PlaceholderExpansion {
User u = essentials.getUser(p);
return u.getReplyRecipient() != null ? u.getReplyRecipient().getName() : "";
case "safe_online":
return String.valueOf((essentials.getOnlinePlayers().size() - essentials.getVanishedPlayers().size()));
int playerHidden = 0;
for (User onlinePlayer : essentials.getOnlineUsers()) {
if (onlinePlayer.isHidden()) {
playerHidden++;
}
}
return String.valueOf((essentials.getOnlinePlayers().size() - playerHidden));
case "worth":
if (p.getItemInHand() == null || p.getItemInHand().getType() == Material.AIR) return "";
BigDecimal worth = essentials.getWorth().getPrice(null, p.getItemInHand());