Package net.minecraft.world.inventory
Class MerchantMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.MerchantMenu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private boolean
private static final int
private static final int
private int
protected static final int
protected static final int
protected static final int
private static final int
private static final int
private static final int
private boolean
private final MerchantContainer
private final Merchant
private static final int
private static final int
Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots
-
Constructor Summary
ConstructorsConstructorDescriptionMerchantMenu
(int pContainerId, Inventory pPlayerInventory) MerchantMenu
(int pContainerId, Inventory pPlayerInventory, Merchant pTrader) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canTakeItemForPickAll
(ItemStack pStack, Slot pSlot) Called to determine if the current slot is valid for the stack merging (double-click) code.int
int
int
private void
moveFromInventoryToPaymentSlot
(int pPaymentSlotIndex, ItemCost pPayment) private void
quickMoveStack
(Player pPlayer, int pIndex) Handle when the stack in slotindex
is shift-clicked.void
Called when the container is closed.void
setCanRestock
(boolean pCanRestock) void
setMerchantLevel
(int pLevel) void
setOffers
(MerchantOffers pOffers) ClientPacketListener
uses this to set offers for the client side MerchantContainer.void
setSelectionHint
(int pCurrentRecipeIndex) void
setShowProgressBar
(boolean pShowProgressBar) void
setXp
(int pXp) boolean
void
slotsChanged
(Container pInventory) Callback for when the crafting matrix is changed.boolean
stillValid
(Player pPlayer) Determines whether supplied player can use this containervoid
tryMoveItems
(int pSelectedMerchantRecipe) Methods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
PAYMENT1_SLOT
protected static final int PAYMENT1_SLOT- See Also:
-
PAYMENT2_SLOT
protected static final int PAYMENT2_SLOT- See Also:
-
RESULT_SLOT
protected static final int RESULT_SLOT- See Also:
-
INV_SLOT_START
private static final int INV_SLOT_START- See Also:
-
INV_SLOT_END
private static final int INV_SLOT_END- See Also:
-
USE_ROW_SLOT_START
private static final int USE_ROW_SLOT_START- See Also:
-
USE_ROW_SLOT_END
private static final int USE_ROW_SLOT_END- See Also:
-
SELLSLOT1_X
private static final int SELLSLOT1_X- See Also:
-
SELLSLOT2_X
private static final int SELLSLOT2_X- See Also:
-
BUYSLOT_X
private static final int BUYSLOT_X- See Also:
-
ROW_Y
private static final int ROW_Y- See Also:
-
trader
-
tradeContainer
-
merchantLevel
private int merchantLevel -
showProgressBar
private boolean showProgressBar -
canRestock
private boolean canRestock
-
-
Constructor Details
-
MerchantMenu
-
MerchantMenu
-
-
Method Details
-
setShowProgressBar
public void setShowProgressBar(boolean pShowProgressBar) -
slotsChanged
Callback for when the crafting matrix is changed.- Overrides:
slotsChanged
in classAbstractContainerMenu
-
setSelectionHint
public void setSelectionHint(int pCurrentRecipeIndex) -
stillValid
Determines whether supplied player can use this container- Specified by:
stillValid
in classAbstractContainerMenu
-
getTraderXp
public int getTraderXp() -
getFutureTraderXp
public int getFutureTraderXp() -
setXp
public void setXp(int pXp) -
getTraderLevel
public int getTraderLevel() -
setMerchantLevel
public void setMerchantLevel(int pLevel) -
setCanRestock
public void setCanRestock(boolean pCanRestock) -
canRestock
public boolean canRestock() -
canTakeItemForPickAll
Called to determine if the current slot is valid for the stack merging (double-click) code. The stack passed in is null for the initial slot that was double-clicked.- Overrides:
canTakeItemForPickAll
in classAbstractContainerMenu
-
quickMoveStack
Handle when the stack in slotindex
is shift-clicked. Normally this moves the stack between the player inventory and the other inventory(s).- Specified by:
quickMoveStack
in classAbstractContainerMenu
-
playTradeSound
private void playTradeSound() -
removed
Called when the container is closed.- Overrides:
removed
in classAbstractContainerMenu
-
tryMoveItems
public void tryMoveItems(int pSelectedMerchantRecipe) -
moveFromInventoryToPaymentSlot
-
setOffers
ClientPacketListener
uses this to set offers for the client side MerchantContainer. -
getOffers
-
showProgressBar
public boolean showProgressBar()
-