Merge pull request #312 from jedk1/master

Fix NPE on player log out.
This commit is contained in:
OmniCypher 2015-11-26 10:44:56 -08:00
commit 5f47ff465b
4 changed files with 22 additions and 4 deletions

View file

@ -110,6 +110,9 @@ public class FreezeMelt {
public static boolean canThaw(Block block) {
if (frozenblocks.containsKey(block)) {
for (Player player : block.getWorld().getPlayers()) {
if (!player.isOnline()) {
return true;
}
if (GeneralMethods.getBoundAbility(player) == null) {
return true;
}

View file

@ -155,10 +155,12 @@ public class IceBlast {
source.revertBlock();
progressing = false;
}
if (player.isOnline()) {
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
if (bPlayer != null) {
bPlayer.addCooldown("IceBlast", cooldown);
}
}
instances.remove(id);
}
@ -228,8 +230,12 @@ public class IceBlast {
}
private void progress() {
if (player.isDead() || !player.isOnline()) {
cancel();
return;
}
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
if (player.isDead() || !player.isOnline() || !GeneralMethods.canBend(player.getName(), "IceBlast") || bPlayer.isOnCooldown("IceBlast")) {
if (!GeneralMethods.canBend(player.getName(), "IceBlast") || bPlayer.isOnCooldown("IceBlast")) {
cancel();
return;
}

View file

@ -159,6 +159,11 @@ public class OctopusForm {
}
private void progress() {
if (player.isDead() || !player.isOnline()) {
remove();
return;
}
if (!GeneralMethods.canBend(player.getName(), "OctopusForm")) {
remove();
returnWater();

View file

@ -563,6 +563,10 @@ public class Torrent {
frozenblocks.remove(block);
continue;
}
if (!player.isOnline()) {
thaw(block);
continue;
}
if (block.getBlock().getWorld() != player.getWorld()) {
thaw(block);
continue;