mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Fix NPE for cracked players on non-bungee environments
This commit is contained in:
@ -110,7 +110,7 @@ public class BungeeListener implements PluginMessageListener {
|
||||
}
|
||||
}, 10L);
|
||||
} else if (type == Type.CRACKED) {
|
||||
//we don't start a forcelogin task here so update it manually
|
||||
//we don't start a force login task here so update it manually
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,12 @@ public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender,
|
||||
|
||||
super.run();
|
||||
|
||||
PremiumStatus status = PremiumStatus.CRACKED;
|
||||
if (isOnlineMode()) {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.PREMIUM);
|
||||
} else {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
||||
status = PremiumStatus.PREMIUM;
|
||||
}
|
||||
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), status);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -67,6 +68,10 @@ public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender,
|
||||
|
||||
@Override
|
||||
public boolean isOnlineMode() {
|
||||
if (session == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return session.isVerified() && player.getName().equals(session.getUsername());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user