Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Added /v command
Browse files Browse the repository at this point in the history
  • Loading branch information
SloudPL committed Mar 19, 2023
1 parent 604de90 commit 8c85991
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/main/java/pl/sloudpl/simplevanish/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,47 @@ public Command(SimpleVanish m){
@Override
public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {

if(sender instanceof Player){
if (command.getName().equalsIgnoreCase("v") || command.getName().equalsIgnoreCase("vanish")){

Player p = (Player) sender;
if(p.hasPermission("sloudpl.vanish") || p.isOp()){
if (sender instanceof Player) {

if(plugin.invisible.contains(p)){
Player p = (Player) sender;

for(Player players : Bukkit.getOnlinePlayers()){
if (p.hasPermission("sloudpl.vanish") || p.isOp()) {

players.showPlayer(p);
if (plugin.invisible.contains(p)) {

}
plugin.invisible.remove(p);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.show")));
for (Player players : Bukkit.getOnlinePlayers()) {

players.showPlayer(p);

}
plugin.invisible.remove(p);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.show")));

} else if(!plugin.invisible.contains(p)) {
} else if (!plugin.invisible.contains(p)) {

for(Player players : Bukkit.getOnlinePlayers()){
for (Player players : Bukkit.getOnlinePlayers()) {

players.hidePlayer(p);
players.hidePlayer(p);

}
plugin.invisible.add(p);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.hide")));

}
plugin.invisible.add(p);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.hide")));

} else {

p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.nopermission")));

}

} else {

p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.nopermission")));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.console")));

}

} else {

sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish.console")));

}

return false;
Expand Down

0 comments on commit 8c85991

Please sign in to comment.