public abstract class PSRegion extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PSRegion.LastRegionTaxPaymentEntry |
static class |
PSRegion.RentStage |
static class |
PSRegion.TaxPayment |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addMember(UUID uuid)
Add a member to the region.
|
abstract void |
addOwner(UUID uuid)
Add an owner to the region.
|
abstract boolean |
deleteRegion(boolean deleteBlock)
Deletes the region forever.
|
abstract boolean |
deleteRegion(boolean deleteBlock,
org.bukkit.entity.Player cause)
Deletes the region forever.
|
boolean |
equals(Object o) |
abstract boolean |
forSale() |
static PSRegion |
fromLocation(org.bukkit.Location l)
Get the protection stone region that the location is in, or the closest one if there are overlapping regions.
|
static PSRegion |
fromLocationGroup(org.bukkit.Location l)
Get the protection stone parent region that the location is in.
|
static PSRegion |
fromLocationGroupUnsafe(org.bukkit.Location l)
Get the protection stone parent region that the location is in.
|
static PSRegion |
fromLocationUnsafe(org.bukkit.Location l)
Get the protection stone region that the location is in, or the closest one if there are overlapping regions.
|
static HashMap<org.bukkit.World,List<PSRegion>> |
fromName(String name)
Get the protection stones regions that have the given name as their set nickname (/ps name), from all worlds.
|
static List<PSRegion> |
fromName(org.bukkit.World w,
String name)
Get the protection stones regions that have the given name as their set nickname (/ps name)
|
static PSRegion |
fromWGRegion(org.bukkit.World w,
com.sk89q.worldguard.protection.regions.ProtectedRegion r)
Get the protection stone region with the world and region.
|
abstract org.bukkit.Location |
getHome()
Get the location of the set home the region has (for /ps tp).
|
abstract String |
getId()
Get the WorldGuard ID of the region.
|
String |
getID()
Deprecated.
|
abstract UUID |
getLandlord()
Get the landlord of the region.
|
abstract ArrayList<UUID> |
getMembers() |
abstract List<PSRegion> |
getMergeableRegions(org.bukkit.entity.Player p)
Get a list of regions that the current region can merge into, taking into account a player's permissions.
|
abstract String |
getName()
Get the name (nickname) of the region from /ps name.
|
abstract ArrayList<UUID> |
getOwners() |
abstract PSRegion |
getParent()
Get the parent of this region, if there is one.
|
abstract List<com.sk89q.worldedit.math.BlockVector2> |
getPoints() |
abstract Double |
getPrice()
Get the price of the region
This applies to either the rent or the full purchase of a region.
|
abstract org.bukkit.block.Block |
getProtectBlock()
This method returns the block that is supposed to contain the protection block.
|
abstract List<PSRegion.LastRegionTaxPaymentEntry> |
getRegionLastTaxPaymentAddedEntries()
Get the list of timestamps of the last time regions and sub regions have added to the tax payments list.
|
abstract Long |
getRentLastPaid()
Get the unix timestamp of when rent was last paid.
|
abstract String |
getRentPeriod()
Get the rent period of the region
|
abstract PSRegion.RentStage |
getRentStage() |
abstract UUID |
getTaxAutopayer()
Get the player that is set to autopay the tax amount.
|
abstract String |
getTaxPaymentPeriod()
Get the formatted period(s) allowed for the payment of tax.
|
abstract List<PSRegion.TaxPayment> |
getTaxPaymentsDue()
Get the list of tax payments that are due.
|
abstract String |
getTaxPeriod()
Get the formatted period(s) between tax payments for this region type.
|
double |
getTaxRate()
Get the tax rate for this region type.
|
abstract UUID |
getTenant()
Get the tenant of the region.
|
abstract String |
getType() |
abstract PSProtectBlock |
getTypeOptions() |
abstract com.sk89q.worldguard.protection.regions.ProtectedRegion |
getWGRegion() |
com.sk89q.worldguard.protection.managers.RegionManager |
getWGRegionManager() |
org.bukkit.World |
getWorld() |
int |
hashCode() |
boolean |
hide()
Hides the protection block, if it is not hidden.
|
boolean |
isHidden()
Must be run sync (calls Bukkit API)
|
abstract boolean |
isMember(UUID uuid)
Get whether or not a player is a member of this region.
|
abstract boolean |
isOwner(UUID uuid)
Get whether or not a player is an owner of this region.
|
abstract boolean |
isTaxPaymentLate()
Check if any tax payments are now late (exceeded tax payment time shown in config).
|
abstract net.milkbowl.vault.economy.EconomyResponse |
payTax(PSPlayer p,
double amount)
Pay outstanding taxes.
|
abstract void |
removeMember(UUID uuid)
Remove a member of the region, and deal with side-effects
|
abstract void |
removeOwner(UUID uuid)
Remove an owner of the region, and deal with side-effects.
|
abstract void |
removeRenting()
Stop renting process and remove tenant.
|
abstract void |
rentOut(UUID landlord,
UUID tenant,
String rentPeriod,
double rentPrice)
Starts renting process (adds to rent queue) tenant.
|
abstract void |
sell(UUID player)
Sells the region to a player at the price listed.
|
abstract void |
setHome(double blockX,
double blockY,
double blockZ)
Set the home of the region (internally changes the flag).
|
abstract void |
setHome(double blockX,
double blockY,
double blockZ,
float yaw,
float pitch)
Set the home of the region (internally changes the flag).
|
abstract void |
setLandlord(UUID landlord)
Set the landlord of the region.
|
abstract void |
setName(String name)
Set the name of the region (from /ps name).
|
abstract void |
setParent(PSRegion r)
Set the parent of this region.
|
abstract void |
setPrice(Double price)
Set the price of the region.
|
abstract void |
setRegionLastTaxPaymentAddedEntries(List<PSRegion.LastRegionTaxPaymentEntry> entries)
Save the list of timestamps of the last time regions and sub regions have added to the tax payments list on to the base region.
|
abstract void |
setRentable(UUID landlord,
String rentPeriod,
double rentPrice)
MUST BE CALLED when the region is looking for a tenant.
|
abstract void |
setRentLastPaid(Long timestamp)
Set the unix timestamp of when rent was last paid.
|
abstract void |
setRentPeriod(String s)
Set the rent period of the region
|
abstract void |
setSellable(boolean forSale,
UUID landlord,
double price)
MUST BE CALLED when setting up the region to be sold or cancelling sale
|
abstract void |
setTaxAutopayer(UUID player)
Set a player to auto-pay taxes for this region.
|
abstract void |
setTaxPaymentsDue(List<PSRegion.TaxPayment> taxPayments)
Save the list of tax payments due onto the region.
|
abstract void |
setTenant(UUID tenant)
Set the tenant of the region
|
void |
setType(PSProtectBlock type)
Change the type of the protection region.
|
void |
toggleHide()
Toggle whether or not the protection block is hidden.
|
boolean |
unhide()
Unhides the protection block, if it is hidden.
|
abstract void |
updateTaxPayments()
Update with the current time and calculate any tax payments that are now due.
|
public static PSRegion fromLocation(org.bukkit.Location l)
PSGroupRegion, PSStandardRegion or PSMergedRegion.l - the locationPSRegion object if the location is in a region, or null if the location is not in a regionpublic static PSRegion fromLocationUnsafe(org.bukkit.Location l)
PSGroupRegion, PSStandardRegion or PSMergedRegion.l - the locationPSRegion object if the location is in a region, or null if the location is not in a regionpublic static PSRegion fromLocationGroup(org.bukkit.Location l)
PSGroupRegion or PSStandardRegion.l - the locationPSRegion object if the location is in a region, or null if the location is not in a regionpublic static PSRegion fromLocationGroupUnsafe(org.bukkit.Location l)
PSGroupRegion or PSStandardRegion.l - the locationPSRegion object if the location is in a region, or null if the location is not in a regionpublic static PSRegion fromWGRegion(org.bukkit.World w, com.sk89q.worldguard.protection.regions.ProtectedRegion r)
w - the worldr - the WorldGuard regionPSRegion based on the parameters, or null if the region given is not a protectionstones regionpublic static List<PSRegion> fromName(org.bukkit.World w, String name)
w - the world to look for regions inname - the nickname of the regionpublic static HashMap<org.bukkit.World,List<PSRegion>> fromName(String name)
name - the nickname of the regionspublic org.bukkit.World getWorld()
@Deprecated public String getID()
public abstract String getId()
public abstract String getName()
public abstract void setName(String name)
name - new name, or null to remove the namepublic abstract void setParent(PSRegion r) throws com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceException
r - the region to be the parent, or null for no parentProtectedRegion.CircularInheritanceException - thrown when the parent already inherits from the childpublic abstract PSRegion getParent()
public abstract org.bukkit.Location getHome()
public abstract void setHome(double blockX,
double blockY,
double blockZ)
blockX - block x locationblockY - block y locationblockZ - block z locationpublic abstract void setHome(double blockX,
double blockY,
double blockZ,
float yaw,
float pitch)
blockX - block x locationblockY - block y locationblockZ - block z locationyaw - location yawpitch - location pitchpublic abstract boolean forSale()
public abstract void setSellable(boolean forSale,
UUID landlord,
double price)
forSale - whether or not the region is for salelandlord - the owner of the regionprice - the price to sell forpublic abstract void sell(UUID player)
player - player to transfer the region topublic abstract PSRegion.RentStage getRentStage()
public abstract UUID getLandlord()
public abstract void setLandlord(UUID landlord)
landlord - uuid of landlord, or null to removepublic abstract UUID getTenant()
public abstract void setTenant(UUID tenant)
tenant - uuid of tenant, or null to removepublic abstract String getRentPeriod()
public abstract void setRentPeriod(String s)
s - the duration between rent payments (d h m s), or null to removepublic abstract Double getPrice()
public abstract void setPrice(Double price)
price - the price of the region, or null if there is no rentpublic abstract void setRentLastPaid(Long timestamp)
timestamp - the unix timestamp of when rent was last paid, or nullpublic abstract Long getRentLastPaid()
public abstract void setRentable(UUID landlord, String rentPeriod, double rentPrice)
landlord - the landlord of the regionrentPeriod - the rent period (d h m s) of the regionrentPrice - the price to charge during each rent paymentpublic abstract void rentOut(UUID landlord, UUID tenant, String rentPeriod, double rentPrice)
landlord - the landlord of the regiontenant - the tenant of the regionrentPeriod - the rent period (d h m s) of the regionrentPrice - the price to charge during each rent paymentpublic abstract void removeRenting()
public double getTaxRate()
public abstract String getTaxPeriod()
public abstract String getTaxPaymentPeriod()
public abstract List<PSRegion.TaxPayment> getTaxPaymentsDue()
public abstract void setTaxPaymentsDue(List<PSRegion.TaxPayment> taxPayments)
taxPayments - the full list of tax payments that are duepublic abstract List<PSRegion.LastRegionTaxPaymentEntry> getRegionLastTaxPaymentAddedEntries()
public abstract void setRegionLastTaxPaymentAddedEntries(List<PSRegion.LastRegionTaxPaymentEntry> entries)
entries - the full list of PSRegion.LastRegionTaxPaymentEntry entries.public abstract UUID getTaxAutopayer()
public abstract void setTaxAutopayer(UUID player)
player - the player to use to auto-pay taxespublic abstract net.milkbowl.vault.economy.EconomyResponse payTax(PSPlayer p, double amount)
p - the player to take money fromamount - the amount to takeEconomyResponse returned by Vaultpublic abstract boolean isTaxPaymentLate()
public abstract void updateTaxPayments()
public boolean isHidden()
public boolean hide()
public boolean unhide()
public void toggleHide()
public abstract org.bukkit.block.Block getProtectBlock()
@Nullable public abstract PSProtectBlock getTypeOptions()
public abstract String getType()
public void setType(PSProtectBlock type)
type - the type of protection region to switch topublic abstract boolean isOwner(UUID uuid)
uuid - the player's uuidpublic abstract boolean isMember(UUID uuid)
uuid - the player's uuidpublic abstract ArrayList<UUID> getOwners()
public abstract ArrayList<UUID> getMembers()
public abstract void addOwner(UUID uuid)
uuid - the uuid of the player to addpublic abstract void addMember(UUID uuid)
uuid - the uuid of the player to addpublic abstract void removeOwner(UUID uuid)
uuid - the uuid of the player to removepublic abstract void removeMember(UUID uuid)
uuid - the uuid of the player to removepublic abstract List<com.sk89q.worldedit.math.BlockVector2> getPoints()
public abstract List<PSRegion> getMergeableRegions(org.bukkit.entity.Player p)
p - the player to compare permissions withpublic abstract boolean deleteRegion(boolean deleteBlock)
deleteBlock - whether or not to also set the protection block to air (if not hidden)public abstract boolean deleteRegion(boolean deleteBlock,
org.bukkit.entity.Player cause)
deleteBlock - whether or not to also set the protection block to air (if not hidden)cause - the player that caused the region to breakpublic abstract com.sk89q.worldguard.protection.regions.ProtectedRegion getWGRegion()
public com.sk89q.worldguard.protection.managers.RegionManager getWGRegionManager()
Copyright © 2021. All rights reserved.