Package net.minecraft.world.inventory
Class MerchantContainer
java.lang.Object
net.minecraft.world.inventory.MerchantContainer
- All Implemented Interfaces:
Iterable<ItemStack>,Clearable,Container,SlotProvider,ContainerExtension
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
Container.ContainerIterator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable MerchantOfferprivate intprivate final NonNullList<ItemStack> private final Merchantprivate intFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid@Nullable MerchantOfferintintgetItem(int index) Returns the stack in the given slot.booleanisEmpty()private booleanisPaymentSlot(int slot) if slot has changed, does updateSellItem need to be called?removeItem(int index, int count) Removes up to a specified number of items from an inventory slot and returns them in a new stack.removeItemNoUpdate(int index) Removes a stack from the given slot and returns it.voidvoidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).voidsetSelectionHint(int currentRecipeIndex) booleanstillValid(Player player) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpenMethods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension
onTransfer, setItemMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRange
-
Field Details
-
merchant
-
itemStacks
-
activeOffer
-
selectionHint
private int selectionHint -
futureXp
private int futureXp
-
-
Constructor Details
-
MerchantContainer
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
Returns the stack in the given slot. -
removeItem
Removes up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItemin interfaceContainer
-
isPaymentSlot
private boolean isPaymentSlot(int slot) if slot has changed, does updateSellItem need to be called? -
removeItemNoUpdate
Removes a stack from the given slot and returns it.- Specified by:
removeItemNoUpdatein interfaceContainer
-
setItem
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
stillValid
- Specified by:
stillValidin interfaceContainer
-
setChanged
public void setChanged()- Specified by:
setChangedin interfaceContainer
-
updateSellItem
public void updateSellItem() -
getActiveOffer
-
setSelectionHint
public void setSelectionHint(int currentRecipeIndex) -
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
getFutureXp
public int getFutureXp()
-