Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
show hidden players in /who list to ops
Browse files Browse the repository at this point in the history
  • Loading branch information
mixxit committed Aug 28, 2019
1 parent fbe35b7 commit 5fbb89d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local.properties
.buildpath
.target
.texlipse
server/

# Java files
*.class
Expand Down
14 changes: 13 additions & 1 deletion src/com/solinia/solinia/Commands/CommandWho.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String

for(Player currentplayer : Bukkit.getServer().getOnlinePlayers())
{
String hidden = "";

if (currentplayer.hasPermission("essentials.silentjoin"))
hidden = "[HIDDEN]";

if (currentplayer.hasPermission("essentials.silentjoin") && !sender.isOp())
{
continue;
}

if (!player.canSee(currentplayer))
hidden = "[HIDDEN]";

if (!player.canSee(currentplayer) && !sender.isOp())
{
continue;
}

if (!filter.equals(""))
if (!currentplayer.getDisplayName().contains(filter))
Expand All @@ -62,7 +74,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
continue;
}

TextComponent tc = new TextComponent(TextComponent.fromLegacyText("["+currentplayer.getName()+"]"+ChatColor.YELLOW + solplayer.getFullName().toUpperCase() + ChatColor.RESET + " ["+ currentplayer.getWorld().getName() +"] - LVL " + ChatColor.AQUA + lvl + ChatColor.RESET + " " + racename + " " + ChatColor.AQUA + classname + ChatColor.RESET));
TextComponent tc = new TextComponent(TextComponent.fromLegacyText(hidden+"["+currentplayer.getName()+"]"+ChatColor.YELLOW + solplayer.getFullName().toUpperCase() + ChatColor.RESET + " ["+ currentplayer.getWorld().getName() +"] - LVL " + ChatColor.AQUA + lvl + ChatColor.RESET + " " + racename + " " + ChatColor.AQUA + classname + ChatColor.RESET));

String worship = "I worship: " + godname + "\n";

Expand Down
2 changes: 2 additions & 0 deletions src/com/solinia/solinia/Models/SoliniaLivingEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5375,6 +5375,8 @@ public boolean checkHateTargets() {
if (this.getBukkitLivingEntity().isDead())
return false;

//System.out.println("Testing checkHateTargets");

if (!(this.getBukkitLivingEntity() instanceof Creature))
return false;

Expand Down

0 comments on commit 5fbb89d

Please sign in to comment.