diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/User.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/User.java | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 01284d4b8..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 @@ -29,6 +31,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser private boolean rightClickJump = false; private transient Location afkPosition = null; private boolean invSee = false; + private boolean recipeSee = false; private boolean enderSee = false; private static final Logger logger = Logger.getLogger("Minecraft"); @@ -70,8 +73,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser } return result; } - - private boolean isAuthorizedCheck(final String node) + + private boolean isAuthorizedCheck(final String node) { if (base instanceof OfflinePlayer) @@ -79,11 +82,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser return false; } - if (isJailed()) - { - return false; - } - try { return ess.getPermissionsHandler().hasPermission(base, node); @@ -306,6 +304,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser if (ess.getSettings().addPrefixSuffix()) { + //These two extra toggles are not documented, because they are mostly redundant #EasterEgg if (!ess.getSettings().disablePrefix()) { final String ptext = ess.getPermissionsHandler().getPrefix(base).replace('&', 'ยง'); @@ -537,7 +536,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser if (broadcast && !isHidden()) { setDisplayNick(); - ess.broadcastMessage(this, _("userIsNotAway", getDisplayName())); + final String msg = _("userIsNotAway", getDisplayName()); + if (!msg.isEmpty()) + { + ess.broadcastMessage(this, msg); + } } } lastActivity = System.currentTimeMillis(); @@ -570,7 +573,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser if (!isHidden()) { setDisplayNick(); - ess.broadcastMessage(this, _("userIsAway", getDisplayName())); + final String msg = _("userIsAway", getDisplayName()); + if (!msg.isEmpty()) + { + ess.broadcastMessage(this, msg); + } } } } @@ -680,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 { @@ -689,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); + } } } @@ -728,4 +743,20 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser { this.rightClickJump = rightClickJump; } + + @Override + public boolean isIgnoreExempt() + { + return this.isAuthorized("essentials.chat.ignoreexempt"); + } + + public boolean isRecipeSee() + { + return recipeSee; + } + + public void setRecipeSee(boolean recipeSee) + { + this.recipeSee = recipeSee; + } } |