Skip to content

Commit

Permalink
Update PlayerListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
leelawd committed Feb 14, 2019
1 parent ca4e06f commit a02c53c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ public void onPlayerLogin(ClientConnectionEvent.Join event) {
Optional<PlayerData> playerData = plugin.getDataStore().getPlayerDataFor(player.getUniqueId());
if (playerData.isPresent() && !playerData.get().getName().equals(player.getName())) {
playerData.get().setName(player.getName());
plugin.getDataStore().updatePlayerData(playerData.get());
}
}).delay(15, TimeUnit.SECONDS).name("betterchunkloader-s-checkUserNameOnLogin").submit(this.plugin);
}

plugin.getDataStore().getPlayerDataFor(player.getUniqueId()).ifPresent((playerData) -> {
playerData.setLastOnline(System.currentTimeMillis());
plugin.getDataStore().updatePlayerData(playerData);
});

final List<ChunkLoader> clList = plugin.getDataStore().getChunkLoadersByOwner(player.getUniqueId());
Expand All @@ -70,6 +72,7 @@ public void onPlayerLogin(ClientConnectionEvent.Join event) {
public void onPlayerQuit(ClientConnectionEvent.Disconnect event, @Root Player player) {
plugin.getDataStore().getPlayerDataFor(player.getUniqueId()).ifPresent((playerData) -> {
playerData.setLastOnline(System.currentTimeMillis());
plugin.getDataStore().updatePlayerData(playerData);
});

final List<ChunkLoader> clList = plugin.getDataStore().getChunkLoadersByOwner(player.getUniqueId());
Expand Down

0 comments on commit a02c53c

Please sign in to comment.