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.BlockReturns 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.voidinteract(org.bukkit.entity.Player player) Processes a player's interaction with the transaction.voidmsgInfo(org.bukkit.command.CommandSender cs) Sends transaction information to the specified command sender.voidpreview(org.bukkit.entity.Player player) Provides a detailed preview of the transaction information to a player.voidSets the owner of this transaction to a new UUID.booleantryCancelTransaction(org.bukkit.entity.Player p) Attempts to cancel the transaction.booleantryCancelTransaction(org.bukkit.entity.Player p, boolean force) Attempts to cancel the transaction with an option to force the cancellation.booleanupdate()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
nullif 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:
trueif the transaction has ended or been finalized;falseotherwise
-
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:
trueif the transaction was successfully cancelled;falseotherwise
-
tryCancelTransaction
boolean tryCancelTransaction(org.bukkit.entity.Player p, boolean force) Attempts to cancel the transaction with an option to force the cancellation.When
forceistrue, the cancellation is performed regardless of normal conditions.- Parameters:
p- the player requesting cancellationforce- iftrue, forces the cancellation of the transaction- Returns:
trueif the transaction was successfully cancelled;falseotherwise
-
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
-