Package dev.espi.protectionstones
Class PSStandardRegion
java.lang.Object
dev.espi.protectionstones.PSRegion
dev.espi.protectionstones.PSStandardRegion
- Direct Known Subclasses:
PSGroupRegion
Represents an instance of a standard PS region, that has not been merged or contains merged regions.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.espi.protectionstones.PSRegion
PSRegion.LastRegionTaxPaymentEntry, PSRegion.RentStage, PSRegion.TaxPayment
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a member to the region.void
Add an owner to the region.boolean
deleteRegion(boolean deleteBlock)
Deletes the region forever.boolean
deleteRegion(boolean deleteBlock, org.bukkit.entity.Player cause)
Deletes the region forever.boolean
forSale()
org.bukkit.Location
getHome()
Get the location of the set home the region has (for /ps tp).getId()
Get the WorldGuard ID of the region.Get the landlord of the region.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.getName()
Get the name (nickname) of the region from /ps name.Get the parent of this region, if there is one.List<com.sk89q.worldedit.math.BlockVector2>
getPrice()
Get the price of the region This applies to either the rent or the full purchase of a region.org.bukkit.block.Block
This method returns the block that is supposed to contain the protection block.Get the list of timestamps of the last time regions and sub regions have added to the tax payments list.Get the unix timestamp of when rent was last paid.Get the rent period of the regionGet the player that is set to autopay the tax amount.Get the formatted period(s) allowed for the payment of tax.Get the list of tax payments that are due.Get the formatted period(s) between tax payments for this region type.Get the tenant of the region.getType()
com.sk89q.worldguard.protection.regions.ProtectedRegion
boolean
Get whether or not a player is a member of this region.boolean
Get whether or not a player is an owner of this region.boolean
Check if any tax payments are now late (exceeded tax payment time shown in config).net.milkbowl.vault.economy.EconomyResponse
Pay outstanding taxes.void
removeMember(UUID uuid)
Remove a member of the region, and deal with side-effectsvoid
removeOwner(UUID uuid)
Remove an owner of the region, and deal with side-effects.void
Stop renting process and remove tenant.void
Starts renting process (adds to rent queue) tenant.void
Sells the region to a player at the price listed.void
setHome(double blockX, double blockY, double blockZ)
Set the home of the region (internally changes the flag).void
setHome(double blockX, double blockY, double blockZ, float yaw, float pitch)
Set the home of the region (internally changes the flag).void
setLandlord(UUID landlord)
Set the landlord of the region.void
Set the name of the region (from /ps name).void
Set the parent of this region.void
Set the price of the region.void
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.void
setRentable(UUID landlord, String rentPeriod, double rentPrice)
MUST BE CALLED when the region is looking for a tenant.void
setRentLastPaid(Long timestamp)
Set the unix timestamp of when rent was last paid.void
setRentPeriod(String s)
Set the rent period of the regionvoid
setSellable(boolean forSale, UUID landlord, double price)
MUST BE CALLED when setting up the region to be sold or cancelling salevoid
setTaxAutopayer(UUID player)
Set a player to auto-pay taxes for this region.void
setTaxPaymentsDue(List<PSRegion.TaxPayment> taxPayments)
Save the list of tax payments due onto the region.void
Set the tenant of the regionvoid
setType(PSProtectBlock type)
Change the type of the protection region.void
Update with the current time and calculate any tax payments that are now due.Methods inherited from class dev.espi.protectionstones.PSRegion
equals, fromLocation, fromLocationGroup, fromLocationGroupUnsafe, fromLocationUnsafe, fromName, fromName, fromWGRegion, getID, getTaxRate, getWGRegionManager, getWorld, hashCode, hide, isHidden, toggleHide, unhide
-
Method Details
-
getId
Description copied from class:PSRegion
Get the WorldGuard ID of the region. Note that this is not guaranteed to be unique between worlds. -
getName
Description copied from class:PSRegion
Get the name (nickname) of the region from /ps name. -
setName
Description copied from class:PSRegion
Set the name of the region (from /ps name). -
setParent
public void setParent(PSRegion r) throws com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceExceptionDescription copied from class:PSRegion
Set the parent of this region. -
getParent
Description copied from class:PSRegion
Get the parent of this region, if there is one. -
getHome
public org.bukkit.Location getHome()Description copied from class:PSRegion
Get the location of the set home the region has (for /ps tp). -
setHome
public void setHome(double blockX, double blockY, double blockZ)Description copied from class:PSRegion
Set the home of the region (internally changes the flag). -
setHome
public void setHome(double blockX, double blockY, double blockZ, float yaw, float pitch)Description copied from class:PSRegion
Set the home of the region (internally changes the flag). -
forSale
public boolean forSale() -
setSellable
Description copied from class:PSRegion
MUST BE CALLED when setting up the region to be sold or cancelling sale- Specified by:
setSellable
in classPSRegion
- Parameters:
forSale
- whether or not the region is for salelandlord
- the owner of the regionprice
- the price to sell for
-
sell
Description copied from class:PSRegion
Sells the region to a player at the price listed. -
getRentStage
- Specified by:
getRentStage
in classPSRegion
- Returns:
- get the stage of the renting process
-
getLandlord
Description copied from class:PSRegion
Get the landlord of the region.- Specified by:
getLandlord
in classPSRegion
- Returns:
- returns the UUID of the landlord, or null if there is none.
-
setLandlord
Description copied from class:PSRegion
Set the landlord of the region.- Specified by:
setLandlord
in classPSRegion
- Parameters:
landlord
- uuid of landlord, or null to remove
-
getTenant
Description copied from class:PSRegion
Get the tenant of the region. -
setTenant
Description copied from class:PSRegion
Set the tenant of the region -
getRentPeriod
Description copied from class:PSRegion
Get the rent period of the region- Specified by:
getRentPeriod
in classPSRegion
- Returns:
- returns the rent duration, or null if there is none
-
setRentPeriod
Description copied from class:PSRegion
Set the rent period of the region- Specified by:
setRentPeriod
in classPSRegion
- Parameters:
s
- the duration between rent payments (d h m s), or null to remove
-
getPrice
Description copied from class:PSRegion
Get the price of the region This applies to either the rent or the full purchase of a region. -
setPrice
Description copied from class:PSRegion
Set the price of the region. This applies to either the rent or the full purchase of a region. -
setRentLastPaid
Description copied from class:PSRegion
Set the unix timestamp of when rent was last paid.- Specified by:
setRentLastPaid
in classPSRegion
- Parameters:
timestamp
- the unix timestamp of when rent was last paid, or null
-
getRentLastPaid
Description copied from class:PSRegion
Get the unix timestamp of when rent was last paid.- Specified by:
getRentLastPaid
in classPSRegion
- Returns:
- the unix timestamp of when rent was last paid, or null if not renting
-
setRentable
Description copied from class:PSRegion
MUST BE CALLED when the region is looking for a tenant.- Specified by:
setRentable
in classPSRegion
- Parameters:
landlord
- the landlord of the regionrentPeriod
- the rent period (d h m s) of the regionrentPrice
- the price to charge during each rent payment
-
rentOut
Description copied from class:PSRegion
Starts renting process (adds to rent queue) tenant. MUST BE CALLED when renting the region out to a tenant. -
removeRenting
public void removeRenting()Description copied from class:PSRegion
Stop renting process and remove tenant. MUST BE CALLED when removing rent.- Specified by:
removeRenting
in classPSRegion
-
getTaxPeriod
Description copied from class:PSRegion
Get the formatted period(s) between tax payments for this region type. If you simply wanted the number of seconds, use getTypeOptions().taxPeriod- Specified by:
getTaxPeriod
in classPSRegion
- Returns:
- the duration between tax payments, or multiple if there are several different ones
-
getTaxPaymentPeriod
Description copied from class:PSRegion
Get the formatted period(s) allowed for the payment of tax. If you simply wanted the number of seconds, use getTypeOptions().taxPaymentTime- Specified by:
getTaxPaymentPeriod
in classPSRegion
- Returns:
- the duration of time allowed to pay a tax, or multiple if there are several different ones
-
getTaxPaymentsDue
Description copied from class:PSRegion
Get the list of tax payments that are due.- Specified by:
getTaxPaymentsDue
in classPSRegion
- Returns:
- the list of tax payments outstanding
-
setTaxPaymentsDue
Description copied from class:PSRegion
Save the list of tax payments due onto the region.- Specified by:
setTaxPaymentsDue
in classPSRegion
- Parameters:
taxPayments
- the full list of tax payments that are due
-
getRegionLastTaxPaymentAddedEntries
Description copied from class:PSRegion
Get the list of timestamps of the last time regions and sub regions have added to the tax payments list.- Specified by:
getRegionLastTaxPaymentAddedEntries
in classPSRegion
- Returns:
- the list of the last time regions and sub regions have added to the tax payment list
-
setRegionLastTaxPaymentAddedEntries
Description copied from class:PSRegion
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.- Specified by:
setRegionLastTaxPaymentAddedEntries
in classPSRegion
- Parameters:
entries
- the full list ofPSRegion.LastRegionTaxPaymentEntry
entries.
-
getTaxAutopayer
Description copied from class:PSRegion
Get the player that is set to autopay the tax amount.- Specified by:
getTaxAutopayer
in classPSRegion
- Returns:
- the player that is set as the autopayer, or null if no player is set
-
setTaxAutopayer
Description copied from class:PSRegion
Set a player to auto-pay taxes for this region.- Specified by:
setTaxAutopayer
in classPSRegion
- Parameters:
player
- the player to use to auto-pay taxes
-
payTax
Description copied from class:PSRegion
Pay outstanding taxes. It will only withdraw the amount required to pay the taxes, and will take up to the amount specified if the outstanding payments are larger. -
isTaxPaymentLate
public boolean isTaxPaymentLate()Description copied from class:PSRegion
Check if any tax payments are now late (exceeded tax payment time shown in config).- Specified by:
isTaxPaymentLate
in classPSRegion
- Returns:
- whether or not any tax payments are now late
-
updateTaxPayments
public void updateTaxPayments()Description copied from class:PSRegion
Update with the current time and calculate any tax payments that are now due.- Specified by:
updateTaxPayments
in classPSRegion
-
getProtectBlock
public org.bukkit.block.Block getProtectBlock()Description copied from class:PSRegion
This method returns the block that is supposed to contain the protection block. Warning: If the protection stone is hidden, this will give the block that took its place!- Specified by:
getProtectBlock
in classPSRegion
- Returns:
- returns the block that may contain the protection stone
-
getTypeOptions
- Specified by:
getTypeOptions
in classPSRegion
- Returns:
- returns the type, or null if the type is not configured
-
getType
-
setType
Description copied from class:PSRegion
Change the type of the protection region. -
isOwner
Description copied from class:PSRegion
Get whether or not a player is an owner of this region. -
isMember
Description copied from class:PSRegion
Get whether or not a player is a member of this region. -
getOwners
-
getMembers
- Specified by:
getMembers
in classPSRegion
- Returns:
- returns a list of the members of the protected region
-
addOwner
Description copied from class:PSRegion
Add an owner to the region. -
addMember
Description copied from class:PSRegion
Add a member to the region. -
removeOwner
Description copied from class:PSRegion
Remove an owner of the region, and deal with side-effects. Examples of side-effects: removing player as landlord, removing player as auto taxpayer- Specified by:
removeOwner
in classPSRegion
- Parameters:
uuid
- the uuid of the player to remove
-
removeMember
Description copied from class:PSRegion
Remove a member of the region, and deal with side-effects- Specified by:
removeMember
in classPSRegion
- Parameters:
uuid
- the uuid of the player to remove
-
getPoints
-
getMergeableRegions
Description copied from class:PSRegion
Get a list of regions that the current region can merge into, taking into account a player's permissions.- Specified by:
getMergeableRegions
in classPSRegion
- Parameters:
p
- the player to compare permissions with- Returns:
- the list of regions that the current region can merge into
-
deleteRegion
public boolean deleteRegion(boolean deleteBlock)Description copied from class:PSRegion
Deletes the region forever. Can be cancelled by event cancellation.- Specified by:
deleteRegion
in classPSRegion
- Parameters:
deleteBlock
- whether or not to also set the protection block to air (if not hidden)- Returns:
- whether or not the region was able to be successfully removed
-
deleteRegion
public boolean deleteRegion(boolean deleteBlock, org.bukkit.entity.Player cause)Description copied from class:PSRegion
Deletes the region forever. Can be cancelled by event cancellation.- Specified by:
deleteRegion
in classPSRegion
- Parameters:
deleteBlock
- whether or not to also set the protection block to air (if not hidden)cause
- the player that caused the region to break- Returns:
- whether or not the region was able to be successfully removed
-
getWGRegion
public com.sk89q.worldguard.protection.regions.ProtectedRegion getWGRegion()- Specified by:
getWGRegion
in classPSRegion
- Returns:
- returns the WorldGuard region object directly
-