Package net.glowstone

Class GlowOfflinePlayer

java.lang.Object
net.glowstone.GlowOfflinePlayer
All Implemented Interfaces:
org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.entity.AnimalTamer, org.bukkit.OfflinePlayer, org.bukkit.permissions.ServerOperator

public final class GlowOfflinePlayer extends Object implements org.bukkit.OfflinePlayer
Represents a player which is not connected to the server.
  • Constructor Details

    • GlowOfflinePlayer

      public GlowOfflinePlayer(GlowServer server, GlowPlayerProfile profile)
      Create a new offline player for the given name. If possible, the player's data will be loaded.
      Parameters:
      server - The server of the offline player. Must not be null.
      profile - The profile associated with the player. Must not be null.
  • Method Details

    • getOfflinePlayer

      public static CompletableFuture<GlowOfflinePlayer> getOfflinePlayer(GlowServer server, UUID uuid)
      Returns a Future for a GlowOfflinePlayer by UUID. If possible, the player's data (including name) will be loaded based on the UUID.
      Parameters:
      server - The server of the offline player. Must not be null.
      uuid - The UUID of the player. Must not be null.
      Returns:
      A GlowOfflinePlayer future.
    • deserialize

      public static org.bukkit.OfflinePlayer deserialize(Map<String,Object> val)
      Required method for configuration serialization.
      Parameters:
      val - map to deserialize
      Returns:
      deserialized player record
      See Also:
      • ConfigurationSerializable
    • getName

      public String getName()
      Specified by:
      getName in interface org.bukkit.entity.AnimalTamer
      Specified by:
      getName in interface org.bukkit.OfflinePlayer
    • getUniqueId

      public UUID getUniqueId()
      Specified by:
      getUniqueId in interface org.bukkit.entity.AnimalTamer
      Specified by:
      getUniqueId in interface org.bukkit.OfflinePlayer
    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface org.bukkit.OfflinePlayer
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Specified by:
      getPlayer in interface org.bukkit.OfflinePlayer
    • hasPlayedBefore

      public boolean hasPlayedBefore()
      Specified by:
      hasPlayedBefore in interface org.bukkit.OfflinePlayer
    • getLastSeen

      public long getLastSeen()
      Specified by:
      getLastSeen in interface org.bukkit.OfflinePlayer
    • isBanned

      public boolean isBanned()
      Specified by:
      isBanned in interface org.bukkit.OfflinePlayer
    • isWhitelisted

      public boolean isWhitelisted()
      Specified by:
      isWhitelisted in interface org.bukkit.OfflinePlayer
    • setWhitelisted

      public void setWhitelisted(boolean value)
      Specified by:
      setWhitelisted in interface org.bukkit.OfflinePlayer
    • getStatistic

      public int getStatistic(org.bukkit.Statistic statistic) throws IllegalArgumentException
      Specified by:
      getStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • getStatistic

      public int getStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      getStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • getStatistic

      public int getStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType) throws IllegalArgumentException
      Specified by:
      getStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • setStatistic

      public void setStatistic(org.bukkit.Statistic statistic, int newValue) throws IllegalArgumentException
      Specified by:
      setStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • setStatistic

      public void setStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material, int newValue) throws IllegalArgumentException
      Specified by:
      setStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • setStatistic

      public void setStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType, int newValue)
      Specified by:
      setStatistic in interface org.bukkit.OfflinePlayer
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic)
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic, int amount)
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material)
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material, int amount)
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType) throws IllegalArgumentException
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • incrementStatistic

      public void incrementStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType, int amount) throws IllegalArgumentException
      Specified by:
      incrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic) throws IllegalArgumentException
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic, int amount) throws IllegalArgumentException
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material) throws IllegalArgumentException
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic, org.bukkit.Material material, int amount) throws IllegalArgumentException
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType) throws IllegalArgumentException
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
      Throws:
      IllegalArgumentException
    • decrementStatistic

      public void decrementStatistic(org.bukkit.Statistic statistic, org.bukkit.entity.EntityType entityType, int amount)
      Specified by:
      decrementStatistic in interface org.bukkit.OfflinePlayer
    • getStatisticMap

      public StatisticMap getStatisticMap()
    • isOp

      public boolean isOp()
      Specified by:
      isOp in interface org.bukkit.permissions.ServerOperator
    • setOp

      public void setOp(boolean value)
      Specified by:
      setOp in interface org.bukkit.permissions.ServerOperator
    • serialize

      public Map<String,Object> serialize()
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProfile

      public GlowPlayerProfile getProfile()
    • getFirstPlayed

      public long getFirstPlayed()
      Specified by:
      getFirstPlayed in interface org.bukkit.OfflinePlayer
    • getLastPlayed

      public long getLastPlayed()
      Specified by:
      getLastPlayed in interface org.bukkit.OfflinePlayer
    • getLastLogin

      public long getLastLogin()
      Specified by:
      getLastLogin in interface org.bukkit.OfflinePlayer
    • getBedSpawnLocation

      public org.bukkit.Location getBedSpawnLocation()
      Specified by:
      getBedSpawnLocation in interface org.bukkit.OfflinePlayer