Modifier and Type | Field and Description |
---|---|
private DefaultedList<ItemStack> |
inventory |
private Merchant |
merchant |
private int |
merchantRewardedExperience |
private int |
recipeIndex |
private TradeOffer |
tradeOffer |
Constructor and Description |
---|
MerchantInventory(Merchant merchant) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPlayerUse(PlayerEntity player) |
void |
clear() |
int |
getMerchantRewardedExperience() |
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
TradeOffer |
getTradeOffer() |
boolean |
isEmpty() |
void |
markDirty() |
private boolean |
needRecipeUpdate(int slot) |
ItemStack |
removeStack(int slot)
Removes the stack currently stored at the indicated slot.
|
ItemStack |
removeStack(int slot,
int amount)
Removes a specific number of items from the given slot.
|
void |
setRecipeIndex(int index) |
void |
setStack(int slot,
ItemStack stack) |
int |
size() |
void |
updateRecipes() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
private final Merchant merchant
private final DefaultedList<ItemStack> inventory
@Nullable private TradeOffer tradeOffer
private int recipeIndex
private int merchantRewardedExperience
public MerchantInventory(Merchant merchant)
public ItemStack getStack(int slot)
ItemStack.EMPTY
.public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
private boolean needRecipeUpdate(int slot)
public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public void updateRecipes()
@Nullable public TradeOffer getTradeOffer()
public void setRecipeIndex(int index)
@Environment(value=CLIENT) public int getMerchantRewardedExperience()