Fixed players considered "unknown" until they create an island

This commit is contained in:
Florian CUNY 2018-09-02 08:50:40 +02:00
parent 5ad363ca11
commit 97222808ac
2 changed files with 3 additions and 3 deletions

View File

@ -36,9 +36,9 @@ public class JoinLeaveListener implements Listener {
return;
}
UUID playerUUID = user.getUniqueId();
// Load player
players.addPlayer(playerUUID);
if (plugin.getPlayers().isKnown(playerUUID)) {
// Load player
players.addPlayer(playerUUID);
// Reset island resets if required
plugin.getIWM().getOverWorlds().stream()
.filter(w -> event.getPlayer().getLastPlayed() < plugin.getIWM().getResetEpoch(w))

View File

@ -122,7 +122,7 @@ public class PlayersManager {
* in the database too.
*
* @param uniqueID - unique ID
* @return true if player is know, otherwise false
* @return true if player is known, otherwise false
*/
public boolean isKnown(UUID uniqueID) {
return uniqueID != null && (playerCache.containsKey(uniqueID) || handler.objectExists(uniqueID.toString()));