mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-14 10:34:41 +02:00
New perm: essentials.vanish.effect - People with this effect will get the potion effect applied while vanished.
63e622374d
This commit is contained in:
@@ -112,6 +112,7 @@ public enum Permissions implements IPermission
|
||||
WARP_LIST(PermissionDefault.TRUE),
|
||||
WARP_HIDDEN,
|
||||
WARP_OTHERS,
|
||||
VANISH_EFFECT,
|
||||
VANISH_EXEMPT,
|
||||
VANISH_SEE_OTHERS,
|
||||
VANISH_PVP,
|
||||
|
@@ -22,6 +22,8 @@ import net.ess3.economy.register.Method;
|
||||
import net.ess3.permissions.Permissions;
|
||||
import net.ess3.utils.DateUtil;
|
||||
import net.ess3.utils.FormatUtil;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
|
||||
public class User extends UserBase implements IUser
|
||||
@@ -635,6 +637,10 @@ public class User extends UserBase implements IUser
|
||||
}
|
||||
}
|
||||
ess.getVanishedPlayers().add(getName());
|
||||
if(Permissions.VANISH_EFFECT.isAuthorized(this))
|
||||
{
|
||||
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -643,6 +649,10 @@ public class User extends UserBase implements IUser
|
||||
p.showPlayer(getPlayer());
|
||||
}
|
||||
ess.getVanishedPlayers().remove(getName());
|
||||
if(Permissions.VANISH_EFFECT.isAuthorized(this))
|
||||
{
|
||||
getPlayer().removePotionEffect(PotionEffectType.INVISIBILITY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user