Fix BendingPlayer NPE of player log out

This commit is contained in:
jedk1 2015-11-25 21:23:27 +00:00
parent 06b999c6c6
commit 4b85875c18
3 changed files with 8 additions and 3 deletions

View file

@ -130,6 +130,9 @@ public class AirBlast implements ConfigLoadable {
if (!origins.containsKey(player))
return;
Location origin = origins.get(player);
if (player.isDead() || !player.isOnline())
return;
if (!origin.getWorld().equals(player.getWorld())) {
origins.remove(player);
return;

View file

@ -94,10 +94,9 @@ public class AirSpout implements ConfigLoadable {
}
public boolean progress() {
if (!GeneralMethods.canBend(player.getName(), "AirSpout")
if (player.isDead() || !player.isOnline() || !GeneralMethods.canBend(player.getName(), "AirSpout")
// || !Methods.hasAbility(player, Abilities.AirSpout)
|| player.getEyeLocation().getBlock().isLiquid() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|| player.isDead() || !player.isOnline()) {
|| player.getEyeLocation().getBlock().isLiquid() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())) {
remove();
return false;
}

View file

@ -103,6 +103,9 @@ public class AirSuction implements ConfigLoadable {
if (!origins.containsKey(player))
return;
Location origin = origins.get(player);
if (player.isDead() || !player.isOnline())
return;
if (!origin.getWorld().equals(player.getWorld())) {
origins.remove(player);
return;