Class Warp
java.lang.Object
com.olziedev.playerwarps.api.warp.Warp
- All Implemented Interfaces:
Comparable<Warp>
Represents a player warp that can manage and handle basic data within a warp.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract long
abstract long
getID()
getPaid()
abstract long
abstract Long
abstract WSponsor
abstract double
getTeleportPrice
(WPlayer wPlayer, boolean containsPercentageCut) Retrieves the teleport price for a player.abstract UUID
getUUID()
abstract Double
abstract long
abstract String
getWarpDescription
(boolean returnDefault) abstract String
abstract WIcon
abstract WLocation
abstract String
abstract String
abstract WPlayer
abstract WRate
abstract WRent
abstract WarpType
abstract WVisit
abstract boolean
abstract boolean
isWarpManager
(CommandSender sender, String permission) abstract boolean
isWarpOwner
(CommandSender sender, String permission) abstract boolean
isWarpOwnerOrManager
(CommandSender sender, String permission) abstract boolean
abstract void
purge()
Purges the warp if the warp is only eligible for one of the purge requirements set in the configuration file.abstract void
removeWarp
(boolean cancelled, CommandSender remover) Removes the warp from the server.abstract void
Modifies the list of banned players from this warp.abstract void
setManagers
(List<UUID> managers) Modifies the managers of this warp.abstract void
Modifies the list of paid players for this warp.abstract void
setRandomSort
(long randomSort) Sets the random sort ID of this warp.abstract void
setSponsorCooldown
(Long sponsorCooldown, boolean change) Modifies the sponsor cooldown for the warp.abstract boolean
setSponsorWarp
(String id, long time, CommandSender sender) Modifies the sponsor warp for this warp.abstract void
setWarpCategory
(List<WCategory> warpCategory) Modifies the warp category.abstract void
setWarpCost
(Double warpCost) Modifies the cost to teleport to the warp.abstract void
setWarpDate
(long warpDate) Modifies the creation date for this warp.abstract void
setWarpDescription
(String description) Modifies the warp description.abstract void
setWarpLocked
(boolean warpLocked) Modifies if the warp is locked or not.abstract void
setWarpName
(String warpName) Modifies the warp name.abstract void
setWarpPassword
(String warpPassword) Modifies the password for this warp to teleport to.abstract void
setWarpPlayer
(WPlayer warpPlayer) Modifies the warp owner.abstract void
setWhitelisted
(List<UUID> whitelisted) Modifies the list of whitelisted players for this warp.abstract void
setWhitelistEnabled
(boolean whitelistEnabled) Modifies if the warp has whitelisting enabled or disabled.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
Warp
public Warp()
-
-
Method Details
-
getID
public abstract long getID()- Returns:
- The unique ID of the warp.
-
getWarpDisplayName
- Returns:
- The name of the warp (With formatting, color codes and spaces)
-
getWarpName
- Returns:
- The name of the warp (Without formatting, color codes and spaces)
-
getUUID
- Returns:
- The owner's UUID of this warp.
-
getManagers
- Returns:
- The managers of this warp.
-
getWarpPlayer
- Returns:
- The owner of this warp.
-
isWarpOwnerOrManager
- 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)
andisWarpManager(CommandSender, String)
for more information.
-
isWarpOwner
- 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
- 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
- Returns:
- The
WLocation
instance of this warp.
-
getWarpCategory
- Returns:
- The
WCategory
instance of this warp.
-
getWarpRent
- Returns:
- The
WRent
instance of this warp.
-
getWarpVisit
- Returns:
- The
WVisit
instance of this warp.
-
getWarpDescription
- Parameters:
returnDefault
- Should the description return the default instead of null?- Returns:
- The description of this warp.
-
getWarpRate
- Returns:
- The
WRate
instance of this warp.
-
getWarpIcon
- Returns:
- The
WIcon
instance of this warp.
-
getWarpDate
public abstract long getWarpDate()- Returns:
- The creation date of this warp in milliseconds.
-
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
- Returns:
- The cost of this warp to teleport.
-
getPaid
- Returns:
- The list of players that have paid to teleport for this warp.
-
getBanned
- Returns:
- The list of players that have been banned from this warp.
-
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
- Returns:
- The sponsor slot for this warp.
-
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
Modifies the warp name.- Parameters:
warpName
- The new warp name.
-
setWarpPlayer
Modifies the warp owner.- Parameters:
warpPlayer
- The new owner.
-
setManagers
Modifies the managers of this warp.- Parameters:
managers
- The new managers.
-
setWarpDescription
Modifies the warp description.- Parameters:
description
- The new description.
-
setWarpCategory
Modifies the warp category.- Parameters:
warpCategory
- The new category.
-
getTeleportPrice
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
Modifies the cost to teleport to the warp.- Parameters:
warpCost
- Cost to teleport.
-
setPaid
Modifies the list of paid players for this warp.- Parameters:
paid
- List of paid players.
-
setBanned
Modifies the list of banned players from this warp.- Parameters:
banned
- List of banned players.
-
setWhitelisted
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
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
- Returns:
- The cooldown for sponsoring again. (in milliseconds or null if no cooldown)
-
setSponsorCooldown
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
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
Removes the warp from the server.- Parameters:
cancelled
- Should the method ignorePlayerWarpRemoveEvent
.remover
- The user who removed the warp.
-