Package dev.espi.protectionstones
Class PSMergedRegion
java.lang.Object
dev.espi.protectionstones.PSRegion
dev.espi.protectionstones.PSMergedRegion
Represents an instance of a PS region that has been merged into another region. There is no actual WG region that
this contains, and instead takes properties from its parent region (see
PSGroupRegion).-
Nested Class Summary
Nested classes/interfaces inherited from class dev.espi.protectionstones.PSRegion
PSRegion.LastRegionTaxPaymentEntry, PSRegion.RentStage, PSRegion.TaxPayment -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a member to the region.voidAdd an owner to the region.booleandeleteRegion(boolean deleteBlock)Deletes the region forever.booleandeleteRegion(boolean deleteBlock, org.bukkit.entity.Player cause)Deletes the region forever.booleanforSale()Get the group region that contains this region.org.bukkit.LocationgetHome()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.static PSMergedRegiongetMergedRegion(org.bukkit.Location l)Finds thePSMergedRegionat a location if the block at that location is the source protection block for it.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.BlockThis 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.ProtectedRegionbooleanGet whether or not a player is a member of this region.booleanGet whether or not a player is an owner of this region.booleanCheck if any tax payments are now late (exceeded tax payment time shown in config).net.milkbowl.vault.economy.EconomyResponsePay outstanding taxes.voidremoveMember(UUID uuid)Remove a member of the region, and deal with side-effectsvoidremoveOwner(UUID uuid)Remove an owner of the region, and deal with side-effects.voidStop renting process and remove tenant.voidStarts renting process (adds to rent queue) tenant.voidSells the region to a player at the price listed.voidsetHome(double blockX, double blockY, double blockZ)Set the home of the region (internally changes the flag).voidsetHome(double blockX, double blockY, double blockZ, float yaw, float pitch)Set the home of the region (internally changes the flag).voidsetLandlord(UUID landlord)Set the landlord of the region.voidSet the name of the region (from /ps name).voidSet the parent of this region.voidSet the price of the region.voidSave the list of timestamps of the last time regions and sub regions have added to the tax payments list on to the base region.voidsetRentable(UUID landlord, String rentPeriod, double rentPrice)MUST BE CALLED when the region is looking for a tenant.voidsetRentLastPaid(Long timestamp)Set the unix timestamp of when rent was last paid.voidsetRentPeriod(String s)Set the rent period of the regionvoidsetSellable(boolean forSale, UUID landlord, double price)MUST BE CALLED when setting up the region to be sold or cancelling salevoidsetTaxAutopayer(UUID uuid)Set a player to auto-pay taxes for this region.voidsetTaxPaymentsDue(List<PSRegion.TaxPayment> taxPayments)Save the list of tax payments due onto the region.voidSet the tenant of the regionvoidsetType(PSProtectBlock type)Change the type of the protection region.voidUpdate 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
-
getMergedRegion
Finds thePSMergedRegionat a location if the block at that location is the source protection block for it.- Parameters:
l- location to look at- Returns:
- the
PSMergedRegionof the source block location, or null if not applicable
-
getGroupRegion
Get the group region that contains this region.- Returns:
- the group region
-
getId
Description copied from class:PSRegionGet the WorldGuard ID of the region. Note that this is not guaranteed to be unique between worlds. -
getName
Description copied from class:PSRegionGet the name (nickname) of the region from /ps name. -
setName
Description copied from class:PSRegionSet 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:PSRegionSet the parent of this region. -
getParent
Description copied from class:PSRegionGet the parent of this region, if there is one. -
getHome
public org.bukkit.Location getHome()Description copied from class:PSRegionGet 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:PSRegionSet 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:PSRegionSet the home of the region (internally changes the flag). -
forSale
public boolean forSale() -
setSellable
Description copied from class:PSRegionMUST BE CALLED when setting up the region to be sold or cancelling sale- Specified by:
setSellablein 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:PSRegionSells the region to a player at the price listed. -
getRentStage
- Specified by:
getRentStagein classPSRegion- Returns:
- get the stage of the renting process
-
getLandlord
Description copied from class:PSRegionGet the landlord of the region.- Specified by:
getLandlordin classPSRegion- Returns:
- returns the UUID of the landlord, or null if there is none.
-
setLandlord
Description copied from class:PSRegionSet the landlord of the region.- Specified by:
setLandlordin classPSRegion- Parameters:
landlord- uuid of landlord, or null to remove
-
getTenant
Description copied from class:PSRegionGet the tenant of the region. -
setTenant
Description copied from class:PSRegionSet the tenant of the region -
getRentPeriod
Description copied from class:PSRegionGet the rent period of the region- Specified by:
getRentPeriodin classPSRegion- Returns:
- returns the rent duration, or null if there is none
-
setRentPeriod
Description copied from class:PSRegionSet the rent period of the region- Specified by:
setRentPeriodin classPSRegion- Parameters:
s- the duration between rent payments (d h m s), or null to remove
-
getPrice
Description copied from class:PSRegionGet the price of the region This applies to either the rent or the full purchase of a region. -
setPrice
Description copied from class:PSRegionSet the price of the region. This applies to either the rent or the full purchase of a region. -
setRentLastPaid
Description copied from class:PSRegionSet the unix timestamp of when rent was last paid.- Specified by:
setRentLastPaidin classPSRegion- Parameters:
timestamp- the unix timestamp of when rent was last paid, or null
-
getRentLastPaid
Description copied from class:PSRegionGet the unix timestamp of when rent was last paid.- Specified by:
getRentLastPaidin classPSRegion- Returns:
- the unix timestamp of when rent was last paid, or null if not renting
-
setRentable
Description copied from class:PSRegionMUST BE CALLED when the region is looking for a tenant.- Specified by:
setRentablein 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:PSRegionStarts 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:PSRegionStop renting process and remove tenant. MUST BE CALLED when removing rent.- Specified by:
removeRentingin classPSRegion
-
getTaxPeriod
Description copied from class:PSRegionGet the formatted period(s) between tax payments for this region type. If you simply wanted the number of seconds, use getTypeOptions().taxPeriod- Specified by:
getTaxPeriodin classPSRegion- Returns:
- the duration between tax payments, or multiple if there are several different ones
-
getTaxPaymentPeriod
Description copied from class:PSRegionGet the formatted period(s) allowed for the payment of tax. If you simply wanted the number of seconds, use getTypeOptions().taxPaymentTime- Specified by:
getTaxPaymentPeriodin classPSRegion- Returns:
- the duration of time allowed to pay a tax, or multiple if there are several different ones
-
getTaxPaymentsDue
Description copied from class:PSRegionGet the list of tax payments that are due.- Specified by:
getTaxPaymentsDuein classPSRegion- Returns:
- the list of tax payments outstanding
-
setTaxPaymentsDue
Description copied from class:PSRegionSave the list of tax payments due onto the region.- Specified by:
setTaxPaymentsDuein classPSRegion- Parameters:
taxPayments- the full list of tax payments that are due
-
getRegionLastTaxPaymentAddedEntries
Description copied from class:PSRegionGet the list of timestamps of the last time regions and sub regions have added to the tax payments list.- Specified by:
getRegionLastTaxPaymentAddedEntriesin classPSRegion- Returns:
- the list of the last time regions and sub regions have added to the tax payment list
-
setRegionLastTaxPaymentAddedEntries
Description copied from class:PSRegionSave 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:
setRegionLastTaxPaymentAddedEntriesin classPSRegion- Parameters:
entries- the full list ofPSRegion.LastRegionTaxPaymentEntryentries.
-
getTaxAutopayer
Description copied from class:PSRegionGet the player that is set to autopay the tax amount.- Specified by:
getTaxAutopayerin classPSRegion- Returns:
- the player that is set as the autopayer, or null if no player is set
-
setTaxAutopayer
Description copied from class:PSRegionSet a player to auto-pay taxes for this region.- Specified by:
setTaxAutopayerin classPSRegion- Parameters:
uuid- the player to use to auto-pay taxes
-
payTax
Description copied from class:PSRegionPay 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:PSRegionCheck if any tax payments are now late (exceeded tax payment time shown in config).- Specified by:
isTaxPaymentLatein classPSRegion- Returns:
- whether or not any tax payments are now late
-
updateTaxPayments
public void updateTaxPayments()Description copied from class:PSRegionUpdate with the current time and calculate any tax payments that are now due.- Specified by:
updateTaxPaymentsin classPSRegion
-
getProtectBlock
public org.bukkit.block.Block getProtectBlock()Description copied from class:PSRegionThis 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:
getProtectBlockin classPSRegion- Returns:
- returns the block that may contain the protection stone
-
getTypeOptions
- Specified by:
getTypeOptionsin classPSRegion- Returns:
- returns the type, or null if the type is not configured
-
getType
-
setType
Description copied from class:PSRegionChange the type of the protection region. -
isOwner
Description copied from class:PSRegionGet whether or not a player is an owner of this region. -
isMember
Description copied from class:PSRegionGet whether or not a player is a member of this region. -
getOwners
-
getMembers
- Specified by:
getMembersin classPSRegion- Returns:
- returns a list of the members of the protected region
-
addOwner
Description copied from class:PSRegionAdd an owner to the region. -
addMember
Description copied from class:PSRegionAdd a member to the region. -
removeOwner
Description copied from class:PSRegionRemove 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:
removeOwnerin classPSRegion- Parameters:
uuid- the uuid of the player to remove
-
removeMember
Description copied from class:PSRegionRemove a member of the region, and deal with side-effects- Specified by:
removeMemberin classPSRegion- Parameters:
uuid- the uuid of the player to remove
-
getPoints
-
getMergeableRegions
Description copied from class:PSRegionGet a list of regions that the current region can merge into, taking into account a player's permissions.- Specified by:
getMergeableRegionsin 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:PSRegionDeletes the region forever. Can be cancelled by event cancellation.- Specified by:
deleteRegionin 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:PSRegionDeletes the region forever. Can be cancelled by event cancellation.- Specified by:
deleteRegionin 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:
getWGRegionin classPSRegion- Returns:
- returns the WorldGuard region object directly
-