mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 19:55:17 +01:00
Fix last login timestamp in Island#showInfo() being 0 due to how OfflinePlayer#getLastPlayed() works.
This commit is contained in:
parent
d0ddf3d9bc
commit
1e791f8497
@ -601,8 +601,11 @@ public class Island implements DataObject {
|
|||||||
user.sendMessage("commands.admin.info.unowned");
|
user.sendMessage("commands.admin.info.unowned");
|
||||||
} else {
|
} else {
|
||||||
user.sendMessage("commands.admin.info.owner", "[owner]", plugin.getPlayers().getName(owner), "[uuid]", owner.toString());
|
user.sendMessage("commands.admin.info.owner", "[owner]", plugin.getPlayers().getName(owner), "[uuid]", owner.toString());
|
||||||
Date d = new Date(plugin.getServer().getOfflinePlayer(owner).getLastPlayed());
|
|
||||||
user.sendMessage("commands.admin.info.last-login","[date]", d.toString());
|
// Fixes #getLastPlayed() returning 0 when it is the owner's first connection.
|
||||||
|
long lastPlayed = (plugin.getServer().getOfflinePlayer(owner).getLastPlayed() != 0) ?
|
||||||
|
plugin.getServer().getOfflinePlayer(owner).getLastPlayed() : plugin.getServer().getOfflinePlayer(owner).getFirstPlayed();
|
||||||
|
user.sendMessage("commands.admin.info.last-login","[date]", new Date(lastPlayed).toString());
|
||||||
|
|
||||||
user.sendMessage("commands.admin.info.deaths", "[number]", String.valueOf(plugin.getPlayers().getDeaths(world, owner)));
|
user.sendMessage("commands.admin.info.deaths", "[number]", String.valueOf(plugin.getPlayers().getDeaths(world, owner)));
|
||||||
String resets = String.valueOf(plugin.getPlayers().getResets(world, owner));
|
String resets = String.valueOf(plugin.getPlayers().getResets(world, owner));
|
||||||
|
Loading…
Reference in New Issue
Block a user