public static interface TradeOfferGenerator.Builder extends ResettableBuilder<TradeOfferGenerator,TradeOfferGenerator.Builder>
TradeOfferGenerator
.Modifier and Type | Method and Description |
---|---|
TradeOfferGenerator |
build()
Builds a new
TradeOfferGenerator . |
TradeOfferGenerator.Builder |
experienceChance(double experienceChance)
Sets the chance when
Random.nextDouble() is called where
if the double is greater than the desired experience chance, the
generated TradeOffer will grant experience upon a
successful trade. |
TradeOfferGenerator.Builder |
maxUses(VariableAmount amount)
Sets the
VariableAmount of maximum uses of the generated
TradeOffer . |
TradeOfferGenerator.Builder |
setPrimaryItemGenerator(ItemStackGenerator generator)
Sets the
ItemStackGenerator for creating the primary item
to be bought by the merchant. |
TradeOfferGenerator.Builder |
setSecondItemGenerator(ItemStackGenerator generator)
Sets the second
ItemStackGenerator for creating the secondary
item to be bought by the merchant. |
TradeOfferGenerator.Builder |
setSellingGenerator(ItemStackGenerator sellingGenerator)
Sets the buying
ItemStackGenerator for creating the selling
item that players are buying. |
TradeOfferGenerator.Builder |
startingUses(VariableAmount amount)
Sets the
VariableAmount of starting uses for the generated
TradeOffer . |
from, reset
TradeOfferGenerator.Builder setPrimaryItemGenerator(ItemStackGenerator generator)
ItemStackGenerator
for creating the primary item
to be bought by the merchant.generator
- The generator that will create the first purchased
itemstackTradeOfferGenerator.Builder setSecondItemGenerator(@Nullable ItemStackGenerator generator)
ItemStackGenerator
for creating the secondary
item to be bought by the merchant.generator
- The generator that will create (if not null) the
second purchased itemstackTradeOfferGenerator.Builder setSellingGenerator(ItemStackGenerator sellingGenerator)
ItemStackGenerator
for creating the selling
item that players are buying.sellingGenerator
- The generator that will create the selling
itemTradeOfferGenerator.Builder experienceChance(double experienceChance)
Random.nextDouble()
is called where
if the double is greater than the desired experience chance, the
generated TradeOffer
will grant experience upon a
successful trade.experienceChance
- The experience chanceTradeOfferGenerator.Builder startingUses(VariableAmount amount)
VariableAmount
of starting uses for the generated
TradeOffer
.amount
- The variable amount of starting usesTradeOfferGenerator.Builder maxUses(VariableAmount amount)
VariableAmount
of maximum uses of the generated
TradeOffer
.amount
- The variable amount of maximum usesTradeOfferGenerator build()
TradeOfferGenerator
.