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

public abstract class BoughtTransaction extends ClaimTransaction
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 Details

    • buyer

      public UUID buyer
      The UUID of the buyer, or null if no buyer has been assigned.
    • exitOffer

      public ExitOffer exitOffer
      An optional exit offer for the transaction.
    • destroyedSign

      public boolean destroyedSign
      Flag indicating whether the sign representing this transaction has been destroyed.
  • Constructor Details

    • BoughtTransaction

      public BoughtTransaction(Map<String,Object> map)
      Constructs a BoughtTransaction from a serialized map.
      Parameters:
      map - the map containing serialized data for this transaction
    • BoughtTransaction

      public BoughtTransaction(IClaim claim, org.bukkit.entity.Player player, double price, org.bukkit.Location sign)
      Constructs a new BoughtTransaction with the specified claim, player, price, and sign location.
      Parameters:
      claim - the claim involved in this transaction
      player - the player initiating the transaction
      price - the price of the transaction
      sign - the location of the transaction sign
  • Method Details

    • serialize

      public Map<String,Object> serialize()
      Serializes this transaction to a map.

      This method includes additional properties specific to bought transactions.

      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
      Overrides:
      serialize in class ClaimTransaction
      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

      public UUID getBuyer()
      Returns the UUID of the buyer.
      Returns:
      the buyer's UUID, or null if no buyer is assigned