Little bit extra sanity checking.

This commit is contained in:
KHobbits 2012-09-09 20:13:03 +01:00
parent 5d372b8149
commit 8718d59286

View file

@ -160,11 +160,14 @@ public class EssentialsPlayerListener implements Listener
user.setLastLogin(System.currentTimeMillis()); user.setLastLogin(System.currentTimeMillis());
user.updateActivity(false); user.updateActivity(false);
if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see"))
{
for (String p : ess.getVanishedPlayers()) for (String p : ess.getVanishedPlayers())
{ {
if (!user.isAuthorized("essentials.vanish.see")) Player toVanish = ess.getUser(p).getBase();
{ if (toVanish.isOnline()) {
user.hidePlayer(ess.getUser(p).getBase()); user.hidePlayer(toVanish);
}
} }
} }
@ -423,7 +426,8 @@ public class EssentialsPlayerListener implements Listener
Location loc = user.getLocation(); Location loc = user.getLocation();
loc.setX(otarget.getX()); loc.setX(otarget.getX());
loc.setZ(otarget.getZ()); 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); loc.setY(loc.getY() + 1d);
} }
user.getBase().teleport(loc, TeleportCause.PLUGIN); user.getBase().teleport(loc, TeleportCause.PLUGIN);