Fix NPE in WaterWave

This commit is contained in:
jedk1 2015-12-21 23:52:26 +00:00
parent a91c165ce0
commit fa92bbe67e

View file

@ -276,10 +276,12 @@ public class WaterWave {
public void remove() { public void remove() {
instances.remove(this); instances.remove(this);
if (player != null && player.isOnline()) {
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName()); BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
if (bPlayer != null) { if (bPlayer != null) {
bPlayer.addCooldown("WaterWave", cooldown); bPlayer.addCooldown("WaterWave", cooldown);
} }
}
revertBlocks(); revertBlocks();
for (BukkitRunnable task : tasks) for (BukkitRunnable task : tasks)
task.cancel(); task.cancel();