Interface Merchant
-
- All Superinterfaces:
Carrier
,DataHolder
,DataHolder.Mutable
,Locatable
,ValueContainer
- All Known Subinterfaces:
Trader
,Villager
,WanderingTrader
public interface Merchant extends DataHolder.Mutable, Carrier, Locatable
Represents a Merchant which can offer trades to customers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Humanoid>
customer()
Gets the currently trading customer with this merchant.void
setCustomer(@Nullable Humanoid humanoid)
Sets the currently trading customer with this merchant.default ListValue.Mutable<TradeOffer>
tradeOffers()
-
Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
-
Methods inherited from interface org.spongepowered.api.world.Locatable
blockPosition, location, serverLocation, world
-
-
-
-
Method Detail
-
customer
java.util.Optional<Humanoid> customer()
Gets the currently trading customer with this merchant.- Returns:
- The currently trading customer if available
-
setCustomer
void setCustomer(@Nullable Humanoid humanoid)
Sets the currently trading customer with this merchant.If the humanoid is available, a new trading window may open with this merchant.
- Parameters:
humanoid
- The humanoid to trade with
-
tradeOffers
default ListValue.Mutable<TradeOffer> tradeOffers()
- Returns:
- The trade offers offered by the merchant
-
-