Interface TradeOffer.Builder
- 
- All Superinterfaces:
- Buildable.Builder<TradeOffer>,- Builder<TradeOffer,TradeOffer.Builder>,- CopyableBuilder<TradeOffer,TradeOffer.Builder>,- DataBuilder<TradeOffer>,- ResettableBuilder<TradeOffer,TradeOffer.Builder>
 - Enclosing interface:
- TradeOffer
 
 public static interface TradeOffer.Builder extends Builder<TradeOffer,TradeOffer.Builder>, CopyableBuilder<TradeOffer,TradeOffer.Builder>, DataBuilder<TradeOffer> Represents a builder to generate immutableTradeOffers.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description TradeOfferbuild()Creates a new TradeOffer instance with the current state of the builder.TradeOffer.BuildercanGrantExperience(boolean experience)Sets the trade offer to be generated to grant experience to the customer upon use.TradeOffer.BuilderdemandBonus(int bonus)Sets the demand bonus for this trade offer.TradeOffer.BuilderfirstBuyingItem(ItemStack item)Sets the first selling item of the trade offer to be generated.TradeOffer.BuildermaxUses(int maxUses)Sets the maximum uses the generated trade offer will have.TradeOffer.BuildermerchantExperienceGranted(int experience)Sets how much experience the trade offer will grant to the merchant upon use.TradeOffer.BuilderpriceGrowthMultiplier(double priceGrowthMultiplier)Sets the rate at which the generated trade offer's price will grow when demand for an item increases.TradeOffer.BuildersecondBuyingItem(ItemStack item)Sets the second selling item of the trade offer to be generated.TradeOffer.BuildersellingItem(ItemStack item)Sets the selling item of the trade offer to be generated.TradeOffer.Builderuses(int uses)Sets the existing uses of the trade offer to be generated.- 
Methods inherited from interface org.spongepowered.api.util.CopyableBuilderfrom
 - 
Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilderbuild
 
- 
 
- 
- 
- 
Method Detail- 
firstBuyingItemTradeOffer.Builder firstBuyingItem(ItemStack item) Sets the first selling item of the trade offer to be generated. Trade offers require at least one item to be generated. - Parameters:
- item- The first item to buy
- Returns:
- This builder
 
 - 
secondBuyingItemTradeOffer.Builder secondBuyingItem(ItemStack item) Sets the second selling item of the trade offer to be generated.- Parameters:
- item- The second item to buy
- Returns:
- This builder
 
 - 
sellingItemTradeOffer.Builder sellingItem(ItemStack item) Sets the selling item of the trade offer to be generated.- Parameters:
- item- The item to sell
- Returns:
- This builder
 
 - 
usesTradeOffer.Builder uses(int uses) Sets the existing uses of the trade offer to be generated. A trade offer will become unusable when the uses surpasses the max uses.- Parameters:
- uses- The uses
- Returns:
- This builder
 
 - 
maxUsesTradeOffer.Builder maxUses(int maxUses) Sets the maximum uses the generated trade offer will have. A trade offer will become unusable when the uses surpasses the max uses.- Parameters:
- maxUses- The maximum uses of the trade offer
- Returns:
- This builder
 
 - 
canGrantExperienceTradeOffer.Builder canGrantExperience(boolean experience) Sets the trade offer to be generated to grant experience to the customer upon use.- Parameters:
- experience- Whether the offer will grant experience
- Returns:
- This builder
 
 - 
merchantExperienceGrantedTradeOffer.Builder merchantExperienceGranted(int experience) Sets how much experience the trade offer will grant to the merchant upon use.- Parameters:
- experience- The amount of experience.
- Returns:
- This builder
 
 - 
priceGrowthMultiplierTradeOffer.Builder priceGrowthMultiplier(double priceGrowthMultiplier) Sets the rate at which the generated trade offer's price will grow when demand for an item increases. Every time a villager trades, this value is multiplied by the current price of the offer and the demand bonus.If this value is 0, trade demand will have no effect on this offer's price. - Parameters:
- priceGrowthMultiplier- The offer's rate of price growth
- Returns:
- This builder
- See Also:
- the Minecraft Wiki for more detail on how the price growth multiplier applies to trade offers
 
 - 
demandBonusTradeOffer.Builder demandBonus(int bonus) Sets the demand bonus for this trade offer.- Parameters:
- bonus- The offer's demand bonus
- Returns:
- This builder
 
 - 
buildTradeOffer build() throws IllegalStateException Creates a new TradeOffer instance with the current state of the builder.- Specified by:
- buildin interface- Buildable.Builder<TradeOffer>
- Returns:
- A new trade offer instance
- Throws:
- IllegalStateException- If the resulting trade offer would be invalid
 
 
- 
 
-