All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.OfflinePlayer Maven / Gradle / Ivy

package org.bukkit;

import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.Player;
import org.bukkit.permissions.ServerOperator;

import java.util.Date;
import java.util.UUID;

public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable {

  /**
   * Checks if this player is currently online
   *
   * @return true if they are online
   */
  boolean isOnline();

  /**
   * Returns the name of this player
   * 

* Names are no longer unique past a single game session. For persistent storage * it is recommended that you use {@link #getUniqueId()} instead. * * @return Player name or null if we have not seen a name for this player yet */ String getName(); /** * Returns the UUID of this player * * @return Player UUID */ UUID getUniqueId(); /** * Checks if this player is banned or not * * @return true if banned, otherwise false */ boolean isBanned(); /** * Bans or unbans this player * * @param banned true if banned * @deprecated Use {@link BanList#addBan(String, String, Date, * String)} or {@link BanList#pardon(String)} to enhance * functionality */ @Deprecated void setBanned(boolean banned); /** * Checks if this player is whitelisted or not * * @return true if whitelisted */ boolean isWhitelisted(); /** * Sets if this player is whitelisted or not * * @param value true if whitelisted */ void setWhitelisted(boolean value); /** * Gets a {@link Player} object that this represents, if there is one *

* If the player is online, this will return that player. Otherwise, * it will return null. * * @return Online player */ 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 */ 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 */ long getLastPlayed(); /** * Checks if this player has played on this server before. * * @return True if the player has played before, otherwise false */ boolean hasPlayedBefore(); /** * Gets the Location where the player will spawn at their bed, null if * they have not slept in one or their current bed spawn is invalid. * * @return Bed Spawn Location if bed exists, otherwise null. */ Location getBedSpawnLocation(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy