mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 03:54:19 +02:00
New perm: essentials.vanish.effect - People with this effect will get the potion effect applied while vanished.
This commit is contained in:
@@ -12,6 +12,8 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
|
||||||
public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
@@ -685,6 +687,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||||||
}
|
}
|
||||||
setHidden(true);
|
setHidden(true);
|
||||||
ess.getVanishedPlayers().add(getName());
|
ess.getVanishedPlayers().add(getName());
|
||||||
|
if (isAuthorized("essentials.vanish.effect"))
|
||||||
|
{
|
||||||
|
this.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -694,6 +700,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||||||
}
|
}
|
||||||
setHidden(false);
|
setHidden(false);
|
||||||
ess.getVanishedPlayers().remove(getName());
|
ess.getVanishedPlayers().remove(getName());
|
||||||
|
if (isAuthorized("essentials.vanish.effect"))
|
||||||
|
{
|
||||||
|
this.removePotionEffect(PotionEffectType.INVISIBILITY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user