001 package org.bukkit; 002 003 import java.util.Date; 004 import java.util.UUID; 005 006 import org.bukkit.configuration.serialization.ConfigurationSerializable; 007 import org.bukkit.entity.AnimalTamer; 008 import org.bukkit.entity.Player; 009 import org.bukkit.permissions.ServerOperator; 010 011 public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable { 012 013 /** 014 * Checks if this player is currently online 015 * 016 * @return true if they are online 017 */ 018 public boolean isOnline(); 019 020 /** 021 * Returns the name of this player 022 * <p> 023 * Names are no longer unique past a single game session. For persistent storage 024 * it is recommended that you use {@link #getUniqueId()} instead. 025 * 026 * @return Player name or null if we have not seen a name for this player yet 027 */ 028 public String getName(); 029 030 /** 031 * Returns the UUID of this player 032 * 033 * @return Player UUID 034 */ 035 public UUID getUniqueId(); 036 037 /** 038 * Checks if this player is banned or not 039 * 040 * @return true if banned, otherwise false 041 */ 042 public boolean isBanned(); 043 044 /** 045 * Bans or unbans this player 046 * 047 * @param banned true if banned 048 * @deprecated Use {@link org.bukkit.BanList#addBan(String, String, Date, 049 * String)} or {@link org.bukkit.BanList#pardon(String)} to enhance 050 * functionality 051 */ 052 @Deprecated 053 public void setBanned(boolean banned); 054 055 /** 056 * Checks if this player is whitelisted or not 057 * 058 * @return true if whitelisted 059 */ 060 public boolean isWhitelisted(); 061 062 /** 063 * Sets if this player is whitelisted or not 064 * 065 * @param value true if whitelisted 066 */ 067 public void setWhitelisted(boolean value); 068 069 /** 070 * Gets a {@link Player} object that this represents, if there is one 071 * <p> 072 * If the player is online, this will return that player. Otherwise, 073 * it will return null. 074 * 075 * @return Online player 076 */ 077 public Player getPlayer(); 078 079 /** 080 * Gets the first date and time that this player was witnessed on this 081 * server. 082 * <p> 083 * If the player has never played before, this will return 0. Otherwise, 084 * it will be the amount of milliseconds since midnight, January 1, 1970 085 * UTC. 086 * 087 * @return Date of first log-in for this player, or 0 088 */ 089 public long getFirstPlayed(); 090 091 /** 092 * Gets the last date and time that this player was witnessed on this 093 * server. 094 * <p> 095 * If the player has never played before, this will return 0. Otherwise, 096 * it will be the amount of milliseconds since midnight, January 1, 1970 097 * UTC. 098 * 099 * @return Date of last log-in for this player, or 0 100 */ 101 public long getLastPlayed(); 102 103 /** 104 * Checks if this player has played on this server before. 105 * 106 * @return True if the player has played before, otherwise false 107 */ 108 public boolean hasPlayedBefore(); 109 110 /** 111 * Gets the Location where the player will spawn at their bed, null if 112 * they have not slept in one or their current bed spawn is invalid. 113 * 114 * @return Bed Spawn Location if bed exists, otherwise null. 115 */ 116 public Location getBedSpawnLocation(); 117 118 }