summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-01-01 21:12:26 +0000
committerKHobbits <rob@khobbits.co.uk>2013-01-01 21:12:26 +0000
commit63e622374d778a8f14e8b73fa3b38a53aea1eb55 (patch)
tree804868ae43156c83b96adef46a64f316e27ba419
parentca25c710107eac9e526c861b3d25fbbdc9813f60 (diff)
downloadEssentials-63e622374d778a8f14e8b73fa3b38a53aea1eb55.tar
Essentials-63e622374d778a8f14e8b73fa3b38a53aea1eb55.tar.gz
Essentials-63e622374d778a8f14e8b73fa3b38a53aea1eb55.tar.lz
Essentials-63e622374d778a8f14e8b73fa3b38a53aea1eb55.tar.xz
Essentials-63e622374d778a8f14e8b73fa3b38a53aea1eb55.zip
New perm: essentials.vanish.effect - People with this effect will get the potion effect applied while vanished.
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index bb1e290f4..6fce1c087 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -12,6 +12,8 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
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
@@ -536,7 +538,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
setDisplayNick();
final String msg = _("userIsNotAway", getDisplayName());
if (!msg.isEmpty())
- {
+ {
ess.broadcastMessage(this, msg);
}
}
@@ -573,7 +575,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
setDisplayNick();
final String msg = _("userIsAway", getDisplayName());
if (!msg.isEmpty())
- {
+ {
ess.broadcastMessage(this, msg);
}
}
@@ -685,6 +687,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setHidden(true);
ess.getVanishedPlayers().add(getName());
+ if (isAuthorized("essentials.vanish.effect"))
+ {
+ this.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
+ }
}
else
{
@@ -694,6 +700,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setHidden(false);
ess.getVanishedPlayers().remove(getName());
+ if (isAuthorized("essentials.vanish.effect"))
+ {
+ this.removePotionEffect(PotionEffectType.INVISIBILITY);
+ }
}
}
@@ -737,7 +747,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override
public boolean isIgnoreExempt()
{
- return this.isAuthorized("essentials.chat.ignoreexempt");
+ return this.isAuthorized("essentials.chat.ignoreexempt");
}
public boolean isRecipeSee()