Interface TradeOfferHelper.WanderingTraderOffersBuilder
- Enclosing class:
TradeOfferHelper
@NonExtendable
@Experimental
public static interface TradeOfferHelper.WanderingTraderOffersBuilder
A builder for rebalanced wandering trader offers.
Experimental feature. This API may receive changes as necessary to adapt to further experiment changes.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Identifier
The pool ID for the "buy items" pool.static final Identifier
The pool ID for the "sell common items" pool.static final Identifier
The pool ID for the "sell special items" pool. -
Method Summary
Modifier and TypeMethodDescriptionaddAll
(Identifier id, Collection<? extends TradeOffers.Factory> factories) Adds trade offers to the offer list.addAll
(Identifier id, TradeOffers.Factory... factories) Adds trade offers to the offer list.addOffersToPool
(Identifier pool, Collection<TradeOffers.Factory> factories) Adds trade offers to an existing pool identified by an ID.addOffersToPool
(Identifier pool, TradeOffers.Factory... factories) Adds trade offers to an existing pool identified by an ID.pool
(Identifier id, int count, Collection<? extends TradeOffers.Factory> factories) Adds a new pool to the offer list.pool
(Identifier id, int count, TradeOffers.Factory... factories) Adds a new pool to the offer list.
-
Field Details
-
BUY_ITEMS_POOL
The pool ID for the "buy items" pool. Two trade offers are picked from this pool.In vanilla, this pool contains offers to buy water buckets, baked potatoes, etc. for emeralds.
-
SELL_SPECIAL_ITEMS_POOL
The pool ID for the "sell special items" pool. Two trade offers are picked from this pool.In vanilla, this pool contains offers to sell logs, enchanted iron pickaxes, etc.
-
SELL_COMMON_ITEMS_POOL
The pool ID for the "sell common items" pool. Five trade offers are picked from this pool.In vanilla, this pool contains offers to sell flowers, saplings, etc.
-
-
Method Details
-
pool
TradeOfferHelper.WanderingTraderOffersBuilder pool(Identifier id, int count, TradeOffers.Factory... factories) Adds a new pool to the offer list. Exactlycount
offers are picked fromfactories
and offered to customers.- Parameters:
id
- the ID to be assigned to this pool, to allow further modificationcount
- the number of offers to be picked fromfactories
factories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IllegalArgumentException
- ifcount
is not positive or iffactories
is empty
-
pool
default TradeOfferHelper.WanderingTraderOffersBuilder pool(Identifier id, int count, Collection<? extends TradeOffers.Factory> factories) Adds a new pool to the offer list. Exactlycount
offers are picked fromfactories
and offered to customers.- Parameters:
id
- the ID to be assigned to this pool, to allow further modificationcount
- the number of offers to be picked fromfactories
factories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IllegalArgumentException
- ifcount
is not positive or iffactories
is empty
-
addAll
default TradeOfferHelper.WanderingTraderOffersBuilder addAll(Identifier id, Collection<? extends TradeOffers.Factory> factories) Adds trade offers to the offer list. All offers fromfactories
are offered to each customer.- Parameters:
id
- the ID to be assigned to this pool, to allow further modificationfactories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IllegalArgumentException
- iffactories
is empty
-
addAll
default TradeOfferHelper.WanderingTraderOffersBuilder addAll(Identifier id, TradeOffers.Factory... factories) Adds trade offers to the offer list. All offers fromfactories
are offered to each customer.- Parameters:
id
- the ID to be assigned to this pool, to allow further modificationfactories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IllegalArgumentException
- iffactories
is empty
-
addOffersToPool
TradeOfferHelper.WanderingTraderOffersBuilder addOffersToPool(Identifier pool, TradeOffers.Factory... factories) Adds trade offers to an existing pool identified by an ID.See the constants for vanilla trade offer pool IDs that are always available.
- Parameters:
pool
- the pool IDfactories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IndexOutOfBoundsException
- ifpool
is out of bounds
-
addOffersToPool
default TradeOfferHelper.WanderingTraderOffersBuilder addOffersToPool(Identifier pool, Collection<TradeOffers.Factory> factories) Adds trade offers to an existing pool identified by an ID.See the constants for vanilla trade offer pool IDs that are always available.
- Parameters:
pool
- the pool IDfactories
- the trade offer factories- Returns:
- this builder, for chaining
- Throws:
IndexOutOfBoundsException
- ifpool
is out of bounds
-