Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
OfflinePlayer.java
1 package org.bukkit;
2 
3 import java.util.Date;
4 import java.util.UUID;
5 
8 import org.bukkit.entity.Player;
10 
12 
13  /**
14  * Checks if this player is currently online
15  *
16  * @return true if they are online
17  */
18  public boolean isOnline();
19 
20  /**
21  * Returns the name of this player
22  * <p>
23  * Names are no longer unique past a single game session. For persistent storage
24  * it is recommended that you use {@link #getUniqueId()} instead.
25  *
26  * @return Player name or null if we have not seen a name for this player yet
27  */
28  public String getName();
29 
30  /**
31  * Returns the UUID of this player
32  *
33  * @return Player UUID
34  */
35  public UUID getUniqueId();
36 
37  /**
38  * Checks if this player is banned or not
39  *
40  * @return true if banned, otherwise false
41  */
42  public boolean isBanned();
43 
44  /**
45  * Bans or unbans this player
46  *
47  * @param banned true if banned
48  * @deprecated Use {@link org.bukkit.BanList#addBan(String, String, Date,
49  * String)} or {@link org.bukkit.BanList#pardon(String)} to enhance
50  * functionality
51  */
52  @Deprecated
53  public void setBanned(boolean banned);
54 
55  /**
56  * Checks if this player is whitelisted or not
57  *
58  * @return true if whitelisted
59  */
60  public boolean isWhitelisted();
61 
62  /**
63  * Sets if this player is whitelisted or not
64  *
65  * @param value true if whitelisted
66  */
67  public void setWhitelisted(boolean value);
68 
69  /**
70  * Gets a {@link Player} object that this represents, if there is one
71  * <p>
72  * If the player is online, this will return that player. Otherwise,
73  * it will return null.
74  *
75  * @return Online player
76  */
77  public Player getPlayer();
78 
79  /**
80  * Gets the first date and time that this player was witnessed on this
81  * server.
82  * <p>
83  * If the player has never played before, this will return 0. Otherwise,
84  * it will be the amount of milliseconds since midnight, January 1, 1970
85  * UTC.
86  *
87  * @return Date of first log-in for this player, or 0
88  */
89  public long getFirstPlayed();
90 
91  /**
92  * Gets the last date and time that this player was witnessed on this
93  * server.
94  * <p>
95  * If the player has never played before, this will return 0. Otherwise,
96  * it will be the amount of milliseconds since midnight, January 1, 1970
97  * UTC.
98  *
99  * @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 }
void setWhitelisted(boolean value)
void setBanned(boolean banned)
Location getBedSpawnLocation()