Class VillagerOffer

java.lang.Object
de.marcely.bedwars.tools.gui.VillagerOffer

public class VillagerOffer extends Object
Represents a buyable offer that can be added to a VillagerGUI
  • Constructor Details

  • Method Details

    • getId

      public UUID getId()
      Returns a random unique id that's bound to this offer
      Returns:
      The id of this offer
    • getResult

      public ItemStack getResult()
      Returns the item that will be given to the player once he purchased it
      Returns:
      The result of the offer
    • getFirstPrice

      public ItemStack getFirstPrice()
      Returns the first item that the player must have and give to purchase the offer
      Returns:
      The first price
    • getSecondPrice

      @Nullable public @Nullable ItemStack getSecondPrice()
      Returns the optional second price that the player must have and give to purchase the offer
      Returns:
      The second price. null if hasSecondPrice() returns false
    • hasSecondPrice

      public boolean hasSecondPrice()
      Returns if a second unique price is required for the player to purchase the item
      Returns:
      true if a second price is given
    • setResult

      public void setResult(ItemStack result)
      Set the item that will be given to the player once the offer has been purchased
      Parameters:
      result - The new result item
    • setFirstPrice

      public void setFirstPrice(ItemStack price1)
      Set the first price that will be taken from the player once he purchased the offer
      Parameters:
      price1 - The new first price
    • setSecondPrice

      public void setSecondPrice(@Nullable @Nullable ItemStack price2)
      Set the new optional second price that will be taken from the player once he purchased the offer
      Parameters:
      price2 - The new second price. May be null if there shouldn't be a second one
    • getNextId

      public static UUID getNextId()
      Returns the getId() that will be used for the next constructed offer
      Returns:
      The id of the next offer