Class Warp

java.lang.Object
com.olziedev.playerwarps.api.warp.Warp
All Implemented Interfaces:
Comparable<Warp>

public abstract class Warp extends Object implements Comparable<Warp>
Represents a player warp that can manage and handle basic data within a warp.
  • Constructor Details

    • Warp

      public Warp()
  • Method Details

    • getID

      public abstract long getID()
      Returns:
      The unique ID of the warp.
    • getWarpDisplayName

      public abstract String getWarpDisplayName()
      Returns:
      The name of the warp (With formatting, color codes and spaces)
    • getWarpName

      public abstract String getWarpName()
      Returns:
      The name of the warp (Without formatting, color codes and spaces)
    • getUUID

      public abstract UUID getUUID()
      Returns:
      The owner's UUID of this warp.
    • getManagers

      public abstract List<UUID> getManagers()
      Returns:
      The managers of this warp.
    • getWarpPlayer

      public abstract WPlayer getWarpPlayer()
      Returns:
      The owner of this warp.
    • isWarpOwnerOrManager

      public abstract boolean isWarpOwnerOrManager(CommandSender sender, String permission)
      Parameters:
      sender - The sender of the command.
      permission - Permission to bypass.
      Returns:
      If the sender of command has access to the permission or the sender is the owner or a manager. Check isWarpOwner(CommandSender, String) and isWarpManager(CommandSender, String) for more information.
    • isWarpOwner

      public abstract boolean isWarpOwner(CommandSender sender, String permission)
      Parameters:
      sender - The sender of the command.
      permission - Permission to bypass.
      Returns:
      If the sender of command has access to the permission or the sender is the owner.
    • isWarpManager

      public abstract boolean isWarpManager(CommandSender sender, String permission)
      Parameters:
      sender - The sender of the command.
      permission - Permission to bypass.
      Returns:
      If the sender of command has access to the permission or if the sender is a manager.
    • getWarpLocation

      public abstract WLocation getWarpLocation()
      Returns:
      The WLocation instance of this warp.
    • getWarpCategory

      public abstract List<WCategory> getWarpCategory()
      Returns:
      The WCategory instance of this warp.
    • getWarpRent

      public abstract WRent getWarpRent()
      Returns:
      The WRent instance of this warp.
    • getWarpVisit

      public abstract WVisit getWarpVisit()
      Returns:
      The WVisit instance of this warp.
    • getWarpDescription

      public abstract String getWarpDescription(boolean returnDefault)
      Parameters:
      returnDefault - Should the description return the default instead of null?
      Returns:
      The description of this warp.
    • getWarpRate

      public abstract WRate getWarpRate()
      Returns:
      The WRate instance of this warp.
    • getWarpIcon

      public abstract WIcon getWarpIcon()
      Returns:
      The WIcon instance of this warp.
    • getWarpDate

      public abstract long getWarpDate()
      Returns:
      The creation date of this warp in milliseconds.
    • getWarpType

      public abstract WarpType getWarpType()
      Returns:
      The type of this warp and how it was created.
    • setWarpDate

      public abstract void setWarpDate(long warpDate)
      Modifies the creation date for this warp.
      Parameters:
      warpDate - New creation date in milliseconds.
    • getWarpCost

      public abstract Double getWarpCost()
      Returns:
      The cost of this warp to teleport.
    • getPaid

      public abstract List<WPayer> getPaid()
      Returns:
      The list of players that have paid to teleport for this warp.
    • getBanned

      public abstract List<WBanned> getBanned()
      Returns:
      The list of players that have been banned from this warp.
    • getWhitelisted

      public abstract List<UUID> getWhitelisted()
      Returns:
      The list of players that have been whitelisted to this warp.
    • isWhitelistEnabled

      public abstract boolean isWhitelistEnabled()
      Returns:
      If the warp has whitelisting enabled or disabled.
    • getSponsorWarp

      public abstract WSponsor getSponsorWarp()
      Returns:
      The sponsor slot for this warp.
    • getWarpPassword

      public abstract String getWarpPassword()
      Returns:
      The password of this warp.
    • isWarpLocked

      public abstract boolean isWarpLocked()
      Returns:
      If the warp is locked.
    • getRandomSort

      public abstract long getRandomSort()
      Returns:
      The random sort ID of this warp.
    • getFavoriteCount

      public abstract long getFavoriteCount()
      Returns:
      The amount of times this warp is a favourite.
    • setRandomSort

      public abstract void setRandomSort(long randomSort)
      Sets the random sort ID of this warp.
      Parameters:
      randomSort - The new random sort ID of this warp.
    • setWarpName

      public abstract void setWarpName(String warpName)
      Modifies the warp name.
      Parameters:
      warpName - The new warp name.
    • setWarpPlayer

      public abstract void setWarpPlayer(WPlayer warpPlayer)
      Modifies the warp owner.
      Parameters:
      warpPlayer - The new owner.
    • setManagers

      public abstract void setManagers(List<UUID> managers)
      Modifies the managers of this warp.
      Parameters:
      managers - The new managers.
    • setWarpDescription

      public abstract void setWarpDescription(String description)
      Modifies the warp description.
      Parameters:
      description - The new description.
    • setWarpCategory

      public abstract void setWarpCategory(List<WCategory> warpCategory)
      Modifies the warp category.
      Parameters:
      warpCategory - The new category.
    • getTeleportPrice

      public abstract double getTeleportPrice(WPlayer wPlayer, boolean containsPercentageCut)
      Retrieves the teleport price for a player.
      Parameters:
      wPlayer - The player to get the teleport price for.
      containsPercentageCut - If the price should contain the percentage cut.
      Returns:
      How much a player will be charged when teleporting to this warp.
    • setWarpCost

      public abstract void setWarpCost(Double warpCost)
      Modifies the cost to teleport to the warp.
      Parameters:
      warpCost - Cost to teleport.
    • setPaid

      public abstract void setPaid(List<WPayer> paid)
      Modifies the list of paid players for this warp.
      Parameters:
      paid - List of paid players.
    • setBanned

      public abstract void setBanned(List<WBanned> banned)
      Modifies the list of banned players from this warp.
      Parameters:
      banned - List of banned players.
    • setWhitelisted

      public abstract void setWhitelisted(List<UUID> whitelisted)
      Modifies the list of whitelisted players for this warp.
      Parameters:
      whitelisted - List of whitelisted players.
    • setWhitelistEnabled

      public abstract void setWhitelistEnabled(boolean whitelistEnabled)
      Modifies if the warp has whitelisting enabled or disabled.
      Parameters:
      whitelistEnabled - If the warp has whitelisting enabled or disabled.
    • setSponsorWarp

      public abstract boolean setSponsorWarp(String id, long time, CommandSender sender)
      Modifies the sponsor warp for this warp.
      Parameters:
      id - The id for the sponsor warp.
      time - The time for how long the sponsor warp is enabled in milliseconds.
      Returns:
      If an error occurred while setting the sponsor.
    • getSponsorCooldown

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

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

      public abstract void setWarpLocked(boolean warpLocked)
      Modifies if the warp is locked or not.
      Parameters:
      warpLocked - Warp visibility.
    • setWarpPassword

      public abstract void setWarpPassword(String warpPassword)
      Modifies the password for this warp to teleport to.
      Parameters:
      warpPassword - Password for the warp.
    • purge

      public abstract void purge()
      Purges the warp if the warp is only eligible for one of the purge requirements set in the configuration file.
    • removeWarp

      public abstract void removeWarp(boolean cancelled, CommandSender remover)
      Removes the warp from the server.
      Parameters:
      cancelled - Should the method ignore PlayerWarpRemoveEvent.
      remover - The user who removed the warp.