Package com.griefdefender.api.data
Interface EconomyData.Builder
- Enclosing interface:
EconomyData
public static interface EconomyData.Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns theEconomyData.forRent(boolean forRent) Enables or disables the rental ofClaim.forSale(boolean forSale) Enables or disables the sale ofClaim.Gets thePaymentType.booleanGets rental break ability.@Nullable InstantGets the rent end date.intGets the maximum rent time.intGets the minimum rent time.doubleGets the rent rate ofClaim.com.flowpowered.math.vector.Vector3iGets the rent sign position.booleanGets whether a rented claim will strip all block NBT data on restore.@Nullable InstantGets the sale end date of claim.doubleGets the sale price ofClaim.com.flowpowered.math.vector.Vector3iGets the sale sign position.booleanGets whether claim is for rent.booleanGets whether claim is for sale.paymentType(PaymentType type) Sets the {link PaymentType}.rentBreakAbility(boolean breakAbility) Sets whether renters or rental trusted users have the ability to break owner blocks inClaim.rentEndDate(@Nullable Instant date) Sets the rent end date.rentMaxTime(int max) Sets the maximum time to rent.rentMinTime(int min) Sets the minimum time to rent.rentRate(double rate) Sets a rent rate forClaim.rentSignPosition(int x, int y, int z) Sets the rent sign pos.rentStripNbt(boolean stripNbt) Sets whether a rented claim will strip all block NBT data on restore.saleEndDate(@Nullable Instant date) Sets the sale end date.salePrice(double price) Sets a sale price forClaim.saleSignPosition(int x, int y, int z) Sets the sale sign pos.
-
Method Details
-
getRentSignPos
com.flowpowered.math.vector.Vector3i getRentSignPos()Gets the rent sign position.- Returns:
- The rent sign position, if available
-
getSaleSignPos
com.flowpowered.math.vector.Vector3i getSaleSignPos()Gets the sale sign position.- Returns:
- The sale sign position, if available
-
getPaymentType
PaymentType getPaymentType()Gets thePaymentType.- Returns:
- The payment type
-
isForSale
boolean isForSale()Gets whether claim is for sale.- Returns:
- whether claim is for sale
-
isForRent
boolean isForRent()Gets whether claim is for rent.- Returns:
- whether claim is for rent
-
getRentBreakAbility
boolean getRentBreakAbility()Gets rental break ability.- Returns:
- Whether renters or rental trusted have ability to break owner blocks.
-
getRentRate
double getRentRate()Gets the rent rate ofClaim.- Returns:
- The rent rate, or -1 if not set.
-
getRentStripNbt
boolean getRentStripNbt()Gets whether a rented claim will strip all block NBT data on restore. Note: This is only used when a rented claim is restored on rental end.- Returns:
- Whether NBT will be stripped on restore
-
getRentEndDate
@Nullable Instant getRentEndDate()Gets the rent end date. Note: If not set, the claim may be rented as long as needed.- Returns:
- The rent end date, if available
-
getSaleEndDate
@Nullable Instant getSaleEndDate()Gets the sale end date of claim.- Returns:
- The sale end date, if available
-
getSalePrice
double getSalePrice()Gets the sale price ofClaim.- Returns:
- The sale price, or -1 if not set.
-
getRentMinTime
int getRentMinTime()Gets the minimum rent time.- Returns:
- The minimum rent time
-
getRentMaxTime
int getRentMaxTime()Gets the maximum rent time.- Returns:
- The maximum rent time
-
rentBreakAbility
Sets whether renters or rental trusted users have the ability to break owner blocks inClaim.- Parameters:
breakAbility-- Returns:
- The builder
-
paymentType
Sets the {link PaymentType}.- Parameters:
type- The payment type- Returns:
- The builder
-
rentMinTime
Sets the minimum time to rent. Note: The time is based ongetPaymentType().- Parameters:
min- The min rent time- Returns:
- The builder
-
rentMaxTime
Sets the maximum time to rent. Note: The time is based ongetPaymentType().- Parameters:
max- The max rent time- Returns:
- The builder
-
rentEndDate
Sets the rent end date. Note: If set, renters may rent until end date. Once end date is reached, the claim will no longer be rentable.- Parameters:
date- The end date- Returns:
- The builder
-
rentRate
Sets a rent rate forClaim.- Parameters:
rate-- Returns:
- The builder
-
rentStripNbt
Sets whether a rented claim will strip all block NBT data on restore. Note: This is only used when a rented claim is restored on rental end.- Parameters:
stripNbt-- Returns:
- The builder
-
saleEndDate
Sets the sale end date. Note: The claim will no longer be for sale when end date is reached.- Parameters:
date- The end date- Returns:
- The builder
-
salePrice
Sets a sale price forClaim.- Parameters:
price- The sale price- Returns:
- The builder
-
forRent
Enables or disables the rental ofClaim.- Parameters:
forRent- true to enable, false to disable- Returns:
- The builder
-
forSale
Enables or disables the sale ofClaim.- Parameters:
forSale- true to enable, false to disable- Returns:
- The builder
-
rentSignPosition
Sets the rent sign pos.- Parameters:
x- The x posy- The y posz- The z pos- Returns:
- The builder
-
saleSignPosition
Sets the sale sign pos.- Parameters:
x- The x posy- The y posz- The z pos- Returns:
- The builder
-
build
EconomyData build()Returns theEconomyData.- Returns:
- The created economy data
-