Interface Transaction
- All Known Implementing Classes:
BoughtTransaction
,ClaimAuction
,ClaimLease
,ClaimRent
,ClaimSell
,ClaimTransaction
Transactions may include operations such as selling, renting, leasing, or auctioning claims. This interface defines the core methods that any transaction type must implement.
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.Block
Returns the block that acts as the physical holder (e.g., a sign) for this transaction.getOwner()
Retrieves the UUID of the owner associated with this transaction.void
interact
(org.bukkit.entity.Player player) Processes a player's interaction with the transaction.void
msgInfo
(org.bukkit.command.CommandSender cs) Sends transaction information to the specified command sender.void
preview
(org.bukkit.entity.Player player) Provides a detailed preview of the transaction information to a player.void
Sets the owner of this transaction to a new UUID.boolean
tryCancelTransaction
(org.bukkit.entity.Player p) Attempts to cancel the transaction.boolean
tryCancelTransaction
(org.bukkit.entity.Player p, boolean force) Attempts to cancel the transaction with an option to force the cancellation.boolean
update()
Updates the current state of the transaction.
-
Method Details
-
getHolder
org.bukkit.block.Block getHolder()Returns the block that acts as the physical holder (e.g., a sign) for this transaction.- Returns:
- the Block representing the transaction holder, or
null
if none exists
-
getOwner
UUID getOwner()Retrieves the UUID of the owner associated with this transaction.- Returns:
- the owner's UUID
-
setOwner
Sets the owner of this transaction to a new UUID.- Parameters:
newOwner
- the new owner's UUID
-
interact
void interact(org.bukkit.entity.Player player) Processes a player's interaction with the transaction.This method is called when a player interacts with the transaction's associated block or sign.
- Parameters:
player
- the player interacting with the transaction
-
preview
void preview(org.bukkit.entity.Player player) Provides a detailed preview of the transaction information to a player.Typically, this displays details such as price, claim location, and other relevant transaction data.
- Parameters:
player
- the player for whom the preview is generated
-
update
boolean update()Updates the current state of the transaction.This method is usually called periodically to update transaction details (e.g., sign text) or to finalize the transaction.
- Returns:
true
if the transaction has ended or been finalized;false
otherwise
-
tryCancelTransaction
boolean tryCancelTransaction(org.bukkit.entity.Player p) Attempts to cancel the transaction.This method checks if the transaction can be cancelled under current conditions.
- Parameters:
p
- the player requesting cancellation- Returns:
true
if the transaction was successfully cancelled;false
otherwise
-
tryCancelTransaction
boolean tryCancelTransaction(org.bukkit.entity.Player p, boolean force) Attempts to cancel the transaction with an option to force the cancellation.When
force
istrue
, the cancellation is performed regardless of normal conditions.- Parameters:
p
- the player requesting cancellationforce
- iftrue
, forces the cancellation of the transaction- Returns:
true
if the transaction was successfully cancelled;false
otherwise
-
msgInfo
void msgInfo(org.bukkit.command.CommandSender cs) Sends transaction information to the specified command sender.This method is typically used to provide a summary of the transaction via command output.
- Parameters:
cs
- the CommandSender (player or console) to receive the transaction info
-