public interface TradeOffer extends DataSerializable
Modifier and Type | Method and Description |
---|---|
boolean |
doesGrantExperience()
Gets whether this trade offer will grant experience upon usage or not.
|
ItemStack |
getFirstBuyingItem()
Gets the first buying item.
|
int |
getMaxUses()
Gets the current maximum uses of this offer.
|
Optional<ItemStack> |
getSecondBuyingItem()
Gets the second buying item.
|
ItemStack |
getSellingItem()
Gets the selling item the
Merchant will give to the customer
often in exchange for a singel item or sometimes, two items from the
following methods: getFirstBuyingItem() and
getSecondBuyingItem() . |
int |
getUses()
Gets the current uses of this offer.
|
boolean |
hasExpired()
Checks if this trade offer has indeed passed the time of which the uses
surpassed the maximum uses.
|
boolean |
hasSecondItem()
Returns whether this trade offer has a second item the merchant is buying
from the customer.
|
toContainer
ItemStack getFirstBuyingItem()
The first buying item is an item that the customer is selling to the
merchant in exchange for getSellingItem()
.
boolean hasSecondItem()
Optional<ItemStack> getSecondBuyingItem()
Gets the second buying item.
The second buying item is an item that the customer is selling to the
merchant, along with the getFirstBuyingItem()
, in exchange for
getSellingItem()
.
ItemStack getSellingItem()
Merchant
will give to the customer
often in exchange for a singel item or sometimes, two items from the
following methods: getFirstBuyingItem()
and
getSecondBuyingItem()
.int getUses()
Gets the current uses of this offer.
Usually, the uses of an offer a re limited by the amount of
getMaxUses()
. Once the uses reaches the max uses, the offer may
temporariliy become disabled.
int getMaxUses()
Gets the current maximum uses of this offer.
Usually, the uses of an offer a re limited by the amount of maximum uses. Once the uses reaches the max uses, the offer may temporariliy become disabled.
boolean hasExpired()
boolean doesGrantExperience()