public static interface TradeOffer.Builder extends DataBuilder<TradeOffer>
TradeOffer
s.Modifier and Type | Method and Description |
---|---|
TradeOffer |
build()
Creates a new TradeOffer instance with the current state of the
builder.
|
TradeOffer.Builder |
canGrantExperience(boolean experience)
Sets the trade offer to be generated to grant experience upon use.
|
TradeOffer.Builder |
firstBuyingItem(ItemStack item)
Sets the first selling item of the trade offer to be
generated.
|
TradeOffer.Builder |
from(TradeOffer offer)
Sets all the settings of this builder with the provided trade offer
as a blueprint.
|
TradeOffer.Builder |
maxUses(int maxUses)
Sets the maximum uses the generated trade offer will have.
|
TradeOffer.Builder |
reset()
Clears all settings of this builder.
|
TradeOffer.Builder |
secondBuyingItem(ItemStack item)
Sets the second selling item of the trade offer to be generated.
|
TradeOffer.Builder |
sellingItem(ItemStack item)
Sets the selling item of the trade offer to be generated.
|
TradeOffer.Builder |
uses(int uses)
Sets the existing uses of the trade offer to be generated.
|
build
TradeOffer.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.
item
- The first item to buyTradeOffer.Builder secondBuyingItem(ItemStack item)
item
- The second item to buyTradeOffer.Builder sellingItem(ItemStack item)
item
- The item to sellTradeOffer.Builder uses(int uses)
uses
- The usesTradeOffer.Builder maxUses(int maxUses)
maxUses
- The maximum uses of the trade offerTradeOffer.Builder canGrantExperience(boolean experience)
experience
- Whether the offer will grant experienceTradeOffer build() throws IllegalStateException
IllegalStateException
- If the resulting trade offer would be
invalidTradeOffer.Builder from(TradeOffer offer)
from
in interface DataBuilder<TradeOffer>
from
in interface ResettableBuilder<TradeOffer,DataBuilder<TradeOffer>>
offer
- The offer to copyTradeOffer.Builder reset()
reset
in interface DataBuilder<TradeOffer>
reset
in interface ResettableBuilder<TradeOffer,DataBuilder<TradeOffer>>