public interface TradeOffer extends DataSerializable
Modifier and Type | Interface and Description |
---|---|
static interface |
TradeOffer.Builder
Represents a builder to generate immutable
TradeOffer s. |
Modifier and Type | Method and Description |
---|---|
static TradeOffer.Builder |
builder()
Creates a new
TradeOffer.Builder to build a TradeOffer . |
boolean |
doesGrantExperience()
Gets whether this trade offer will grant experience upon usage or not.
|
ItemStackSnapshot |
getFirstBuyingItem()
Gets the first buying item.
|
int |
getMaxUses()
Gets the current maximum uses of this offer.
|
Optional<ItemStackSnapshot> |
getSecondBuyingItem()
Gets the second buying item.
|
ItemStackSnapshot |
getSellingItem()
Gets the selling item the
Merchant will give to the customer
often in exchange for a single 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.
|
getContentVersion, toContainer
static TradeOffer.Builder builder()
TradeOffer.Builder
to build a TradeOffer
.ItemStackSnapshot getFirstBuyingItem()
The first buying item is an item that the customer is selling to the
merchant in exchange for getSellingItem()
.
boolean hasSecondItem()
Optional<ItemStackSnapshot> 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()
.
ItemStackSnapshot getSellingItem()
Merchant
will give to the customer
often in exchange for a single 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 are limited by the amount of
getMaxUses()
. Once the uses reaches the max uses, the offer may
temporarily become disabled.
int getMaxUses()
Gets the current maximum uses of this offer.
Usually, the uses of an offer are limited by the amount of maximum uses. Once the uses reaches the max uses, the offer may temporarily become disabled.
boolean hasExpired()
boolean doesGrantExperience()