Package dev.espi.protectionstones
Class PSGroupRegion
java.lang.Object
dev.espi.protectionstones.PSRegion
dev.espi.protectionstones.PSStandardRegion
dev.espi.protectionstones.PSGroupRegion
Represents a region that exists but is a group of merged
PSStandardRegion
s.
Contains multiple PSMergedRegion
representing the individual merged regions (which don't technically exist in WorldGuard).-
Nested Class Summary
Nested classes/interfaces inherited from class dev.espi.protectionstones.PSRegion
PSRegion.LastRegionTaxPaymentEntry, PSRegion.RentStage, PSRegion.TaxPayment
-
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteRegion(boolean deleteBlock, org.bukkit.entity.Player cause)
Deletes the region forever.Get the list ofPSMergedRegion
objects of the regions that were merged into this region.Get the list ofPSMergedRegion
objects of the regions that were merged into this region.Get the merged region whose ID is the same as the group region ID.Get the formatted period(s) allowed for the payment of tax.Get the formatted period(s) between tax payments for this region type.double
Get the tax rate for this region type.boolean
hasMergedRegion(String id)
Check if this region contains a specific merged regionboolean
hide()
Hides the protection block, if it is not hidden.void
Removes the merged region's information from the object.boolean
unhide()
Unhides the protection block, if it is hidden.void
Update with the current time and calculate any tax payments that are now due.Methods inherited from class dev.espi.protectionstones.PSStandardRegion
addMember, addOwner, deleteRegion, forSale, getHome, getId, getLandlord, getMembers, getMergeableRegions, getName, getOwners, getParent, getPoints, getPrice, getProtectBlock, getRegionLastTaxPaymentAddedEntries, getRentLastPaid, getRentPeriod, getRentStage, getTaxAutopayer, getTaxPaymentsDue, getTenant, getType, getTypeOptions, getWGRegion, isMember, isOwner, isTaxPaymentLate, payTax, removeMember, removeOwner, removeRenting, rentOut, sell, setHome, setHome, setLandlord, setName, setParent, setPrice, setRegionLastTaxPaymentAddedEntries, setRentable, setRentLastPaid, setRentPeriod, setSellable, setTaxAutopayer, setTaxPaymentsDue, setTenant, setType
Methods inherited from class dev.espi.protectionstones.PSRegion
equals, fromLocation, fromLocationGroup, fromLocationGroupUnsafe, fromLocationUnsafe, fromName, fromName, fromWGRegion, getID, getWGRegionManager, getWorld, hashCode, isHidden, toggleHide
-
Method Details
-
getTaxRate
public double getTaxRate()Description copied from class:PSRegion
Get the tax rate for this region type.- Overrides:
getTaxRate
in classPSRegion
- Returns:
- the tax rate
-
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- Overrides:
getTaxPeriod
in classPSStandardRegion
- 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- Overrides:
getTaxPaymentPeriod
in classPSStandardRegion
- Returns:
- the duration of time allowed to pay a tax, or multiple if there are several different ones
-
updateTaxPayments
public void updateTaxPayments()Description copied from class:PSRegion
Update with the current time and calculate any tax payments that are now due.- Overrides:
updateTaxPayments
in classPSStandardRegion
-
hide
public boolean hide()Description copied from class:PSRegion
Hides the protection block, if it is not hidden. -
unhide
public boolean unhide()Description copied from class:PSRegion
Unhides the protection block, if it is hidden. -
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.- Overrides:
deleteRegion
in classPSStandardRegion
- 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
-
getRootRegion
Get the merged region whose ID is the same as the group region ID.- Returns:
- the root region
-
hasMergedRegion
Check if this region contains a specific merged region- Parameters:
id
- the psID that would've been generated if the merged region was a standard region- Returns:
- whether or not the id is a merged region
-
removeMergedRegionInfo
Removes the merged region's information from the object. Note: This DOES NOT remove the actual PSMergedRegion object, you have to call deleteRegion() on that as well.- Parameters:
id
- the id of the merged region
-
getMergedRegions
Get the list ofPSMergedRegion
objects of the regions that were merged into this region.- Returns:
- the list of regions merged into this region
-
getMergedRegionsUnsafe
Get the list ofPSMergedRegion
objects of the regions that were merged into this region. Note: This is unsafe as it includesPSMergedRegion
s that are of types not configured in the config.- Returns:
- the list of regions merged into this region
-