Class BoughtTransaction
java.lang.Object
me.EtienneDx.RealEstate.Transactions.ClaimTransaction
me.EtienneDx.RealEstate.Transactions.BoughtTransaction
- All Implemented Interfaces:
Transaction
,org.bukkit.configuration.serialization.ConfigurationSerializable
- Direct Known Subclasses:
ClaimLease
,ClaimRent
Represents a transaction for a claim that has been bought.
This abstract class extends ClaimTransaction
and adds additional properties
specific to transactions where a claim has been purchased, including the buyer's UUID,
an exit offer, and a flag indicating whether the transaction sign has been destroyed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe UUID of the buyer, ornull
if no buyer has been assigned.boolean
Flag indicating whether the sign representing this transaction has been destroyed.An optional exit offer for the transaction.Fields inherited from class me.EtienneDx.RealEstate.Transactions.ClaimTransaction
claimId, owner, price, sign
-
Constructor Summary
ConstructorsConstructorDescriptionBoughtTransaction
(Map<String, Object> map) Constructs aBoughtTransaction
from a serialized map.BoughtTransaction
(IClaim claim, org.bukkit.entity.Player player, double price, org.bukkit.Location sign) Constructs a newBoughtTransaction
with the specified claim, player, price, and sign location. -
Method Summary
Methods inherited from class me.EtienneDx.RealEstate.Transactions.ClaimTransaction
getClaim, getHolder, getOwner, getOwnerUUID, getPrice, getSign, setOwner, tryCancelTransaction
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.EtienneDx.RealEstate.Transactions.Transaction
interact, msgInfo, preview, tryCancelTransaction, update
-
Field Details
-
buyer
The UUID of the buyer, ornull
if no buyer has been assigned. -
exitOffer
An optional exit offer for the transaction. -
destroyedSign
public boolean destroyedSignFlag indicating whether the sign representing this transaction has been destroyed.
-
-
Constructor Details
-
BoughtTransaction
-
BoughtTransaction
public BoughtTransaction(IClaim claim, org.bukkit.entity.Player player, double price, org.bukkit.Location sign) Constructs a newBoughtTransaction
with the specified claim, player, price, and sign location.- Parameters:
claim
- the claim involved in this transactionplayer
- the player initiating the transactionprice
- the price of the transactionsign
- the location of the transaction sign
-
-
Method Details
-
serialize
Serializes this transaction to a map.This method includes additional properties specific to bought transactions.
- Specified by:
serialize
in interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
- Overrides:
serialize
in classClaimTransaction
- Returns:
- a map representing the serialized form of this transaction
-
destroySign
public void destroySign()Destroys the transaction sign if it has not already been destroyed.This method checks whether the sign is configured to be destroyed and, if so, it breaks the sign naturally in the world.
-
getBuyer
Returns the UUID of the buyer.- Returns:
- the buyer's UUID, or
null
if no buyer is assigned
-