From f6bfce4fa1a1222814f3bb8732369e41580393e2 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 12 Dec 2011 17:38:27 +0000 Subject: [PATCH] Added OfflinePlayer + Player .getLastPlayed, .getFirstPlayed, .hasPlayedBefore By: Nathan Adams --- .../main/java/org/bukkit/OfflinePlayer.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index 76f499fc08..2f4ca39f28 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -57,4 +57,31 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @return Online player */ public Player getPlayer(); + + /** + * Gets the first date and time that this player was witnessed on this server. + *

+ * If the player has never played before, this will return 0. Otherwise, it will be + * the amount of milliseconds since midnight, January 1, 1970 UTC. + * + * @return Date of first log-in for this player, or 0 + */ + public long getFirstPlayed(); + + /** + * Gets the last date and time that this player was witnessed on this server. + *

+ * If the player has never played before, this will return 0. Otherwise, it will be + * the amount of milliseconds since midnight, January 1, 1970 UTC. + * + * @return Date of last log-in for this player, or 0 + */ + public long getLastPlayed(); + + /** + * Checks if this player has played on this server before. + * + * @return True if the player has played before, otherwise false + */ + public boolean hasPlayedBefore(); }