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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdds a banned player to the list of players that are banned from this warp.abstract voidaddManager(UUID manager) Adds a manager to this warp.abstract voidAdds a payer to the list of players that have paid to teleport to this warp.abstract voidaddWhitelisted(UUID player) Adds a whitelisted player to the list of players that are whitelisted for this warp.abstract longabstract longgetID()getPaid()abstract longabstract List<WPlayer.WCurrencyContainer> abstract Longabstract WSponsorabstract WCurrency.CurrencySectiongetTeleportPrice(WPlayer wPlayer, Function<Double, Double> priceFunction) Retrieves the teleport price for a player.abstract UUIDgetUUID()abstract Doubleabstract longabstract StringgetWarpDescription(boolean returnDefault) abstract Stringabstract WIconabstract WLocationabstract Stringabstract Stringabstract WPlayerabstract WRateabstract WRentabstract WarpTypeabstract WVisitabstract booleanabstract booleanisWarpManager(CommandSender sender, String permission) abstract booleanisWarpOwner(CommandSender sender, String permission) abstract booleanisWarpOwnerOrManager(CommandSender sender, String permission) abstract booleanabstract voidpurge()Purges the warp if the warp is only eligible for one of the purge requirements set in the configuration file.abstract voidremoveBanned(WBanned banned) Removes a banned player from the list of players that are banned from this warp.abstract voidremoveManager(UUID manager) Removes a manager from this warp.abstract voidremovePayer(WPayer payer) Removes a payer from the list of players that have paid to teleport to this warp.abstract voidremoveWarp(boolean cancelled, CommandSender remover) Removes the warp from the server.abstract voidremoveWhitelisted(UUID player) Removes a whitelisted player from the list of players that are whitelisted for this warp.abstract voidsetRandomSort(long randomSort) Sets the random sort ID of this warp.abstract voidsetSponsorCooldown(Long sponsorCooldown, boolean change) Modifies the sponsor cooldown for the warp.abstract booleansetSponsorWarp(String id, long time, CommandSender sender) Modifies the sponsor warp for this warp.abstract voidsetWarpCategory(List<WCategory> warpCategory) Modifies the warp category.abstract voidsetWarpCost(Double warpCost) Modifies the cost to teleport to the warp.abstract voidsetWarpDate(long warpDate) Modifies the creation date for this warp.abstract voidsetWarpDescription(String description) Modifies the warp description.abstract voidsetWarpLocked(boolean warpLocked) Modifies if the warp is locked or not.abstract voidsetWarpName(String warpName) Modifies the warp name.abstract voidsetWarpPassword(String warpPassword) Modifies the password for this warp to teleport to.abstract voidsetWarpPlayer(WPlayer warpPlayer) Modifies the warp owner.abstract voidsetWarpTags(Map<String, String> tags) Modifies the warp tags.abstract voidsetWhitelistEnabled(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, waitMethods 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
WLocationinstance of this warp.
-
getWarpCategory
- Returns:
- The
WCategoryinstance of this warp.
-
getWarpRent
- Returns:
- The
WRentinstance of this warp.
-
getWarpVisit
- Returns:
- The
WVisitinstance of this warp.
-
getWarpDescription
- Parameters:
returnDefault- Should the description return the default instead of null?- Returns:
- The description of this warp.
-
getWarpRate
- Returns:
- The
WRateinstance of this warp.
-
getWarpIcon
- Returns:
- The
WIconinstance 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.
-
getSetPrices
- Returns:
- How much a player paid when creating this warp.
-
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.
-
addManager
Adds a manager to this warp.- Parameters:
manager- The manager to add.
-
removeManager
Removes a manager from this warp.- Parameters:
manager- The manager to remove.
-
setWarpDescription
Modifies the warp description.- Parameters:
description- The new description.
-
setWarpCategory
Modifies the warp category.- Parameters:
warpCategory- The new category.
-
getTeleportPrice
public abstract WCurrency.CurrencySection getTeleportPrice(WPlayer wPlayer, Function<Double, Double> priceFunction) Retrieves the teleport price for a player.- Parameters:
wPlayer- The player to calculate the teleport price for.priceFunction- The function to modify the price.- 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.
-
addPaid
Adds a payer to the list of players that have paid to teleport to this warp.- Parameters:
payer- The payer to add.
-
removePayer
Removes a payer from the list of players that have paid to teleport to this warp.- Parameters:
payer- The payer to remove.
-
addBanned
Adds a banned player to the list of players that are banned from this warp.- Parameters:
banned- The banned player to add.
-
removeBanned
Removes a banned player from the list of players that are banned from this warp.- Parameters:
banned- The banned player to remove.
-
addWhitelisted
Adds a whitelisted player to the list of players that are whitelisted for this warp.- Parameters:
player- The whitelisted player to add.
-
removeWhitelisted
Removes a whitelisted player from the list of players that are whitelisted for this warp.- Parameters:
player- The whitelisted player to remove.
-
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.
-
setWarpTags
Modifies the warp tags.- Parameters:
tags- The warp tags to set.
-
getWarpTags
- Returns:
- The warp tags for this 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.
-