Skip to content

Instantly share code, notes, and snippets.

@md-5
Created May 17, 2012 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save md-5/2717184 to your computer and use it in GitHub Desktop.
Save md-5/2717184 to your computer and use it in GitHub Desktop.
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.entity.Player;
public class Commandvanish extends EssentialsCommand
{
public Commandvanish()
{
super("vanish");
}
@Override
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
if (user.isVanished())
{
for (Player p : server.getOnlinePlayers())
{
p.showPlayer(user);
}
}
else
{
for (Player p : server.getOnlinePlayers())
{
if (!ess.getUser(p).isAuthorized("essentials.vanish.see"))
{
p.hidePlayer(user);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment