Package de.marcely.bedwars.tools.gui
Class VillagerOffer
java.lang.Object
de.marcely.bedwars.tools.gui.VillagerOffer
Represents a buyable offer that can be added to a
VillagerGUI-
Constructor Summary
ConstructorsConstructorDescriptionVillagerOffer(ItemStack result, List<ItemStack> prices) VillagerOffer(ItemStack result, ItemStack price1) VillagerOffer(ItemStack result, ItemStack price1, @Nullable ItemStack price2) -
Method Summary
Modifier and TypeMethodDescriptionReturns the first item that the player must have and give to purchase the offergetId()Returns a random unique id that's bound to this offerstatic UUIDReturns thegetId()that will be used for the next constructed offerReturns the item that will be given to the player once he purchased it@Nullable ItemStackReturns the optional second price that the player must have and give to purchase the offerbooleanReturns if a second unique price is required for the player to purchase the itemvoidsetFirstPrice(ItemStack price1) Set the first price that will be taken from the player once he purchased the offervoidSet the item that will be given to the player once the offer has been purchasedvoidsetSecondPrice(@Nullable ItemStack price2) Set the new optional second price that will be taken from the player once he purchased the offer
-
Constructor Details
-
VillagerOffer
-
VillagerOffer
-
VillagerOffer
-
-
Method Details
-
getId
Returns a random unique id that's bound to this offer- Returns:
- The id of this offer
-
getResult
Returns the item that will be given to the player once he purchased it- Returns:
- The result of the offer
-
getFirstPrice
Returns the first item that the player must have and give to purchase the offer- Returns:
- The first price
-
getSecondPrice
Returns the optional second price that the player must have and give to purchase the offer- Returns:
- The second price.
nullifhasSecondPrice()returns false
-
hasSecondPrice
public boolean hasSecondPrice()Returns if a second unique price is required for the player to purchase the item- Returns:
trueif a second price is given
-
setResult
Set the item that will be given to the player once the offer has been purchased- Parameters:
result- The new result item
-
setFirstPrice
Set the first price that will be taken from the player once he purchased the offer- Parameters:
price1- The new first price
-
setSecondPrice
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
Returns thegetId()that will be used for the next constructed offer- Returns:
- The id of the next offer
-