mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-18 05:16:12 +00:00
Telesphoreo
e294ef8312
- SuperVanish has a wack permission system, and it didn't work in some rare circumstances. Added back TFMs vanish with the SuperVanish API - Fixed the permission nodes so admins can see other admins, like how it was in TFM
44 lines
1.4 KiB
Java
44 lines
1.4 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import de.myzelyam.api.vanish.VanishAPI;
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
|
@CommandParameters(description = "Hide yourself from other players", usage = "/<command> [-s]", aliases = "v,ev,evanish")
|
|
public class Command_vanish extends FreedomCommand
|
|
{
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
if (args.length == 0)
|
|
{
|
|
if (!VanishAPI.isInvisible(playerSender))
|
|
{
|
|
VanishAPI.hidePlayer(playerSender);
|
|
}
|
|
else
|
|
{
|
|
VanishAPI.showPlayer(playerSender);
|
|
}
|
|
}
|
|
else if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-v"))
|
|
{
|
|
if (!VanishAPI.isInvisible(playerSender))
|
|
{
|
|
VanishAPI.getPlugin().getVisibilityChanger().hidePlayer(playerSender, null, true);
|
|
}
|
|
else
|
|
{
|
|
VanishAPI.getPlugin().getVisibilityChanger().showPlayer(playerSender, null, true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
} |