mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Fix BendingPlayer NPE of player log out
This commit is contained in:
parent
06b999c6c6
commit
4b85875c18
3 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue