summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-09 20:13:03 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-09 20:13:03 +0100
commit8718d59286cbb90892449a6384d13daa0fe5381b (patch)
tree6ed59d8b1b7c47dcd4df356517fa4e1f842bd61e
parent5d372b81497c8f969051438bd5d4cb54c41a8837 (diff)
downloadEssentials-8718d59286cbb90892449a6384d13daa0fe5381b.tar
Essentials-8718d59286cbb90892449a6384d13daa0fe5381b.tar.gz
Essentials-8718d59286cbb90892449a6384d13daa0fe5381b.tar.lz
Essentials-8718d59286cbb90892449a6384d13daa0fe5381b.tar.xz
Essentials-8718d59286cbb90892449a6384d13daa0fe5381b.zip
Little bit extra sanity checking.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 03417ac1f..ab32a47df 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -160,11 +160,14 @@ public class EssentialsPlayerListener implements Listener
user.setLastLogin(System.currentTimeMillis());
user.updateActivity(false);
- for (String p : ess.getVanishedPlayers())
+ if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see"))
{
- if (!user.isAuthorized("essentials.vanish.see"))
+ for (String p : ess.getVanishedPlayers())
{
- user.hidePlayer(ess.getUser(p).getBase());
+ Player toVanish = ess.getUser(p).getBase();
+ if (toVanish.isOnline()) {
+ user.hidePlayer(toVanish);
+ }
}
}
@@ -384,7 +387,7 @@ public class EssentialsPlayerListener implements Listener
}
break;
case LEFT_CLICK_AIR:
- if (event.getPlayer().isFlying())
+ if (event.getPlayer().isFlying())
{
final User user = ess.getUser(event.getPlayer());
if (user.isFlyClickJump())
@@ -423,7 +426,8 @@ public class EssentialsPlayerListener implements Listener
Location loc = user.getLocation();
loc.setX(otarget.getX());
loc.setZ(otarget.getZ());
- while (Util.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() -1, loc.getBlockZ())) {
+ while (Util.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ()))
+ {
loc.setY(loc.getY() + 1d);
}
user.getBase().teleport(loc, TeleportCause.PLUGIN);