Interface TradeOfferGenerator.Builder
-
- All Superinterfaces:
Buildable.Builder<TradeOfferGenerator>
,Builder<TradeOfferGenerator,TradeOfferGenerator.Builder>
,CopyableBuilder<TradeOfferGenerator,TradeOfferGenerator.Builder>
,ResettableBuilder<TradeOfferGenerator,TradeOfferGenerator.Builder>
- Enclosing interface:
- TradeOfferGenerator
public static interface TradeOfferGenerator.Builder extends Builder<TradeOfferGenerator,TradeOfferGenerator.Builder>, CopyableBuilder<TradeOfferGenerator,TradeOfferGenerator.Builder>
A simple builder to create aTradeOfferGenerator
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TradeOfferGenerator
build()
Builds a newTradeOfferGenerator
.TradeOfferGenerator.Builder
experienceChance(double experienceChance)
Sets the chance whenRandom.nextDouble()
is called where if the double is greater than the desired experience chance, the generatedTradeOffer
will grant experience upon a successful trade.TradeOfferGenerator.Builder
firstBuyingItemGenerator(ItemStackGenerator generator)
Sets theItemStackGenerator
for creating the primary item to be bought by the merchant.TradeOfferGenerator.Builder
grantedExperience(VariableAmount amount)
TradeOfferGenerator.Builder
maxUses(VariableAmount amount)
Sets theVariableAmount
of maximum uses of the generatedTradeOffer
.TradeOfferGenerator.Builder
secondBuyingItemGenerator(@Nullable ItemStackGenerator generator)
Sets the secondItemStackGenerator
for creating the secondary item to be bought by the merchant.TradeOfferGenerator.Builder
sellingItemGenerator(ItemStackGenerator sellingGenerator)
Sets the buyingItemStackGenerator
for creating the selling item that players are buying.TradeOfferGenerator.Builder
startingUses(VariableAmount amount)
Sets theVariableAmount
of starting uses for the generatedTradeOffer
.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
-
-
-
Method Detail
-
firstBuyingItemGenerator
TradeOfferGenerator.Builder firstBuyingItemGenerator(ItemStackGenerator generator)
Sets theItemStackGenerator
for creating the primary item to be bought by the merchant.- Parameters:
generator
- The generator that will create the first purchased itemstack- Returns:
- This builder, for chaining
-
secondBuyingItemGenerator
TradeOfferGenerator.Builder secondBuyingItemGenerator(@Nullable ItemStackGenerator generator)
Sets the secondItemStackGenerator
for creating the secondary item to be bought by the merchant.- Parameters:
generator
- The generator that will create (if not null) the second purchased itemstack- Returns:
- This builder, for chaining
-
sellingItemGenerator
TradeOfferGenerator.Builder sellingItemGenerator(ItemStackGenerator sellingGenerator)
Sets the buyingItemStackGenerator
for creating the selling item that players are buying.- Parameters:
sellingGenerator
- The generator that will create the selling item- Returns:
- This builder, for chaining
-
experienceChance
TradeOfferGenerator.Builder experienceChance(double experienceChance)
Sets the chance whenRandom.nextDouble()
is called where if the double is greater than the desired experience chance, the generatedTradeOffer
will grant experience upon a successful trade.- Parameters:
experienceChance
- The experience chance- Returns:
- This builder, for chaining
-
grantedExperience
TradeOfferGenerator.Builder grantedExperience(VariableAmount amount)
-
startingUses
TradeOfferGenerator.Builder startingUses(VariableAmount amount)
Sets theVariableAmount
of starting uses for the generatedTradeOffer
.- Parameters:
amount
- The variable amount of starting uses- Returns:
- This builder, for chaining
-
maxUses
TradeOfferGenerator.Builder maxUses(VariableAmount amount)
Sets theVariableAmount
of maximum uses of the generatedTradeOffer
.- Parameters:
amount
- The variable amount of maximum uses- Returns:
- This builder, for chaining
-
build
TradeOfferGenerator build()
Builds a newTradeOfferGenerator
.- Specified by:
build
in interfaceBuildable.Builder<TradeOfferGenerator>
- Returns:
- The newly created generator
-
-