Class WPlayer

java.lang.Object
com.olziedev.playerwarps.api.player.WPlayer

public abstract class WPlayer extends Object
Handles and manages all the player data.
  • Constructor Details

    • WPlayer

      public WPlayer()
  • Method Details

    • getUUID

      public abstract UUID getUUID()
      Returns:
      The UUID of the warp player.
    • getName

      public abstract String getName()
      Returns:
      The last known warp player's name.
    • getPlayer

      public abstract Player getPlayer()
      Returns:
      The Bukkit player instance.
    • getOfflinePlayer

      public abstract OfflinePlayer getOfflinePlayer()
      Returns:
      The Bukkit offline player instance.
    • getWarps

      public abstract List<Warp> getWarps(boolean showLocked)
      Parameters:
      showLocked - Add locked warps to the list.
      Returns:
      List of the warps owned by the player.
    • getPlayerWarps

      public abstract List<Warp> getPlayerWarps(boolean showLocked, CommandSender sender)
      Parameters:
      showLocked - Add locked warps to the list.
      sender - The command sender, this is to check if they can see specific warps or not.
      Returns:
      List of the warps owned by the player.
    • getUsedWarps

      public abstract long getUsedWarps(CommandSender sender)
      Parameters:
      sender - The command sender to check if they can see specific warps or not.
      Returns:
      The current warps the player has.
    • getMaximumWarps

      public abstract long getMaximumWarps()
      Returns:
      The maximum amount of warps a player can set. Retrieves it from the permission or static amount.
    • getPrettyMaximumWarps

      public abstract String getPrettyMaximumWarps()
      Returns:
      The pretty maximum amount of warps a player can set. Retrieves it from the permission or static amount.
    • getStaticWarps

      public abstract long getStaticWarps()
      Returns:
      The static amount of warps a player can set.
    • getLastPlayed

      public abstract long getLastPlayed()
      Returns:
      When the player last logged offline.
    • setLastPlayed

      public abstract void setLastPlayed(Long time)
      Modifies the last time a player last logged offline.
      Parameters:
      time - Last logged offline in milliseconds.
    • getPendingWarp

      public abstract Warp getPendingWarp()
      Returns:
      The warp that the player is teleporting to on another server.
    • setPendingWarp

      public abstract void setPendingWarp(Warp playerWarp, Runnable expire)
      Modifies the pending warp that the player will teleport to on another server.
      Parameters:
      playerWarp - Pending warp to teleport to.
      expire - The runnable for when the pending eatp expires.
    • getSponsorCooldown

      public abstract Long getSponsorCooldown()
      Returns:
      The cooldown for sponsoring a warp. (in milliseconds or null if no cooldown.)
    • setSponsorCooldown

      public abstract void setSponsorCooldown(Long sponsorCooldown, boolean change)
      Modifies the sponsor cooldown for the player.
      Parameters:
      sponsorCooldown - Sponsor cooldown in milliseconds.
      change - If the cooldown should persist.
    • getVisitedWarps

      public abstract List<Warp> getVisitedWarps(CommandSender sender)
      Parameters:
      sender - The command sender to check if they can see specific warps or not.
      Returns:
      List of warps the player has recently visited.
    • setVisitedWarps

      public abstract void setVisitedWarps(List<Warp> visitedWarps)
      Modifies the list of recently visited warps for this player.
      Parameters:
      visitedWarps - List of visited warps.
    • getFavouriteWarps

      public abstract List<Warp> getFavouriteWarps(CommandSender sender)
      Parameters:
      sender - The command sender to check if they can see specific warps or not.
      Returns:
      List of warps the player has listed as a favourite.
    • setFavouriteWarps

      public abstract void setFavouriteWarps(List<Warp> favouriteWarps)
      Modifies the list of favourite warps for this player.
      Parameters:
      favouriteWarps - List of favourite warps.
    • getMessages

      public abstract List<String> getMessages()
      Returns:
      List of pending offline messages the player has.
    • manageMessage

      public abstract void manageMessage(String message, boolean add)
      Add or remove an offline message from a player.
      Parameters:
      message - The offline message the player should see when joined.
      add - Add a message or remove a message?
    • getLogs

      public abstract List<String> getLogs()
      Returns:
      List of the logged actions.
    • setLogs

      public abstract void setLogs(List<String> logs)
      Modifies the logged actions for this player.
      Parameters:
      logs - Logged actions.
    • getGUIPlayer

      public abstract WGUIPlayer getGUIPlayer()
      Returns:
      The GUIPlayer object, used for saving values when a GUI is opened.
    • refreshName

      public abstract void refreshName()
      Update the player's name for, called when joined. getName()
    • purgeLimit

      public abstract void purgeLimit()
      Purge the players warps if they have gone over their warp limit.
    • setStaticWarps

      public abstract void setStaticWarps(long addedWarps)
      Modifies the static maximum warps a player can set.
      Parameters:
      addedWarps - Static maximum amount of warps.
    • getSetPrice

      public abstract double getSetPrice()
      Returns:
      How much they will be charged when setting a warp.
    • setSetPrice

      public abstract void setSetPrice(double setPrice)
      Modifies the warp price to create a warp for a player. (Doesn't persist!)
      Parameters:
      setPrice - Price to create a warp.
    • getMaxWarpCostPrice

      public abstract double getMaxWarpCostPrice()
      Returns:
      The maximum warp teleport cost.
    • getMinWarpCostPrice

      public abstract double getMinWarpCostPrice()
      Returns:
      The minimum warp teleport cost.
    • getPriceFreeLimit

      public abstract int getPriceFreeLimit()
      Returns:
      The amount of warps a player can set for free.
    • getWaitTeleportTime

      public abstract int getWaitTeleportTime()
      Returns:
      The wait time in seconds to teleport to a warp.
    • getLanguage

      public abstract String getLanguage()
      Returns:
      The language the player will receive messages in.
    • setLanguage

      public abstract void setLanguage(String language)
      Modifies the language the player will receive messages in.
      Parameters:
      language - The language that the plugin supports.
    • getEarnedRateRewards

      public abstract List<String> getEarnedRateRewards()
      Returns:
      The list of all the earned rate rewards for this player.
    • setEarnedRateRewards

      public abstract void setEarnedRateRewards(List<String> earnedRateRewards)
      Modifies the list of all the earned rate rewards for this player.
      Parameters:
      earnedRateRewards - List of all the earned rate rewards.