Class MerchantScreenHandler
- Mappings:
- Namespace - Name - official - ccm- intermediary - net/minecraft/class_1728- named - net/minecraft/screen/MerchantScreenHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate static final intprivate static final intprotected static final intprivate static final intprotected static final intprivate static final intprivate static final intprivate static final intprivate booleanprivate intprivate final Merchantprivate final MerchantInventoryprotected static final intprivate static final intprivate static final intFields inherited from class net.minecraft.screen.ScreenHandlerEMPTY_SPACE_SLOT_INDEX, field_30731, field_30732, field_30733, field_30734, field_30735, field_30736, field_30737, slots, syncId
- 
Constructor SummaryConstructorsConstructorDescriptionMerchantScreenHandler(int syncId, PlayerInventory playerInventory) MerchantScreenHandler(int syncId, PlayerInventory playerInventory, Merchant merchant) 
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidbooleancanInsertIntoSlot(ItemStack stack, Slot slot) Returns whetherstackcan be inserted toslot.booleanbooleancanUse(PlayerEntity player) Returns whether the screen handler can be used.intintintbooleanvoidonClosed(PlayerEntity player) Called when this screen handler is closed.voidonContentChanged(Inventory inventory) Called when a slot's content has changed.private voidquickMove(PlayerEntity player, int slot) Quick-moves the stack atslotto other slots of the screen handler that belong to a different inventory or another section of the same inventory.voidsetCanRefreshTrades(boolean canRefreshTrades) voidsetExperienceFromServer(int experience) voidsetLeveled(boolean leveled) voidsetLevelProgress(int levelProgress) voidsetOffers(TradeOfferList offers) voidsetRecipeIndex(int index) voidswitchTo(int recipeIndex) Methods inherited from class net.minecraft.screen.ScreenHandleraddListener, addProperties, addProperty, addSlot, calculateComparatorOutput, calculateComparatorOutput, calculateStackSize, canInsertIntoSlot, canInsertItemIntoSlot, canUse, checkDataCount, checkSize, copySharedSlots, disableSyncing, dropInventory, enableSyncing, endQuickCraft, getCursorStack, getRevision, getSlot, getSlotIndex, getStacks, getType, insertItem, isValid, nextRevision, onButtonClick, onSlotClick, packQuickCraftData, removeListener, sendContentUpdates, setCursorStack, setPreviousCursorStack, setPreviousTrackedSlot, setPreviousTrackedSlotMutable, setProperty, setStackInSlot, shouldQuickCraftContinue, syncState, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks, updateSyncHandler, updateToClient
- 
Field Details- 
INPUT_1_IDprotected static final int INPUT_1_ID- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - k- Lccm;k:I- intermediary - field_30830- Lnet/minecraft/class_1728;field_30830:I- named - INPUT_1_ID- Lnet/minecraft/screen/MerchantScreenHandler;INPUT_1_ID:I
 
- 
INPUT_2_IDprotected static final int INPUT_2_ID- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - l- Lccm;l:I- intermediary - field_30831- Lnet/minecraft/class_1728;field_30831:I- named - INPUT_2_ID- Lnet/minecraft/screen/MerchantScreenHandler;INPUT_2_ID:I
 
- 
OUTPUT_IDprotected static final int OUTPUT_ID- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - m- Lccm;m:I- intermediary - field_30832- Lnet/minecraft/class_1728;field_30832:I- named - OUTPUT_ID- Lnet/minecraft/screen/MerchantScreenHandler;OUTPUT_ID:I
 
- 
INVENTORY_STARTprivate static final int INVENTORY_START- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - n- Lccm;n:I- intermediary - field_30833- Lnet/minecraft/class_1728;field_30833:I- named - INVENTORY_START- Lnet/minecraft/screen/MerchantScreenHandler;INVENTORY_START:I
 
- 
INVENTORY_ENDprivate static final int INVENTORY_END- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - o- Lccm;o:I- intermediary - field_30834- Lnet/minecraft/class_1728;field_30834:I- named - INVENTORY_END- Lnet/minecraft/screen/MerchantScreenHandler;INVENTORY_END:I
 
- 
HOTBAR_STARTprivate static final int HOTBAR_START- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - p- Lccm;p:I- intermediary - field_30835- Lnet/minecraft/class_1728;field_30835:I- named - HOTBAR_START- Lnet/minecraft/screen/MerchantScreenHandler;HOTBAR_START:I
 
- 
HOTBAR_ENDprivate static final int HOTBAR_END- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - q- Lccm;q:I- intermediary - field_30836- Lnet/minecraft/class_1728;field_30836:I- named - HOTBAR_END- Lnet/minecraft/screen/MerchantScreenHandler;HOTBAR_END:I
 
- 
INPUT_1_Xprivate static final int INPUT_1_X- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - r- Lccm;r:I- intermediary - field_30837- Lnet/minecraft/class_1728;field_30837:I- named - INPUT_1_X- Lnet/minecraft/screen/MerchantScreenHandler;INPUT_1_X:I
 
- 
INPUT_2_Xprivate static final int INPUT_2_X- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - s- Lccm;s:I- intermediary - field_30838- Lnet/minecraft/class_1728;field_30838:I- named - INPUT_2_X- Lnet/minecraft/screen/MerchantScreenHandler;INPUT_2_X:I
 
- 
OUTPUT_Xprivate static final int OUTPUT_X- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - t- Lccm;t:I- intermediary - field_30839- Lnet/minecraft/class_1728;field_30839:I- named - OUTPUT_X- Lnet/minecraft/screen/MerchantScreenHandler;OUTPUT_X:I
 
- 
SLOT_Yprivate static final int SLOT_Y- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - u- Lccm;u:I- intermediary - field_30840- Lnet/minecraft/class_1728;field_30840:I- named - SLOT_Y- Lnet/minecraft/screen/MerchantScreenHandler;SLOT_Y:I
 
- 
merchant- Mappings:
- Namespace - Name - Mixin selector - official - v- Lccm;v:Lclj;- intermediary - field_7863- Lnet/minecraft/class_1728;field_7863:Lnet/minecraft/class_1915;- named - merchant- Lnet/minecraft/screen/MerchantScreenHandler;merchant:Lnet/minecraft/village/Merchant;
 
- 
merchantInventory- Mappings:
- Namespace - Name - Mixin selector - official - w- Lccm;w:Lccl;- intermediary - field_7861- Lnet/minecraft/class_1728;field_7861:Lnet/minecraft/class_1725;- named - merchantInventory- Lnet/minecraft/screen/MerchantScreenHandler;merchantInventory:Lnet/minecraft/village/MerchantInventory;
 
- 
levelProgressprivate int levelProgress- Mappings:
- Namespace - Name - Mixin selector - official - x- Lccm;x:I- intermediary - field_18669- Lnet/minecraft/class_1728;field_18669:I- named - levelProgress- Lnet/minecraft/screen/MerchantScreenHandler;levelProgress:I
 
- 
leveledprivate boolean leveled- Mappings:
- Namespace - Name - Mixin selector - official - y- Lccm;y:Z- intermediary - field_18670- Lnet/minecraft/class_1728;field_18670:Z- named - leveled- Lnet/minecraft/screen/MerchantScreenHandler;leveled:Z
 
- 
canRefreshTradesprivate boolean canRefreshTrades- Mappings:
- Namespace - Name - Mixin selector - official - z- Lccm;z:Z- intermediary - field_19358- Lnet/minecraft/class_1728;field_19358:Z- named - canRefreshTrades- Lnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades:Z
 
 
- 
- 
Constructor Details- 
MerchantScreenHandler- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lccm;<init>(ILbyn;)V- intermediary - <init>- Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;)V- named - <init>- Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
 
- 
MerchantScreenHandler- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lccm;<init>(ILbyn;Lclj;)V- intermediary - <init>- Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_1915;)V- named - <init>- Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/village/Merchant;)V
 
 
- 
- 
Method Details- 
setLeveledpublic void setLeveled(boolean leveled) - Mappings:
- Namespace - Name - Mixin selector - official - a- Lccm;a(Z)V- intermediary - method_19253- Lnet/minecraft/class_1728;method_19253(Z)V- named - setLeveled- Lnet/minecraft/screen/MerchantScreenHandler;setLeveled(Z)V
 
- 
onContentChangedCalled when a slot's content has changed.This is not called by default; subclasses that override this method should also use a custom InventorywhosemarkDirtymethod is overridden to call this method as a backing inventory of the slot.This can be used to update the output slot when input changes. - Overrides:
- onContentChangedin class- ScreenHandler
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcbf;a(Lbdq;)V- intermediary - method_7609- Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)V- named - onContentChanged- Lnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
 
- 
setRecipeIndexpublic void setRecipeIndex(int index) - Mappings:
- Namespace - Name - Mixin selector - official - e- Lccm;e(I)V- intermediary - method_7650- Lnet/minecraft/class_1728;method_7650(I)V- named - setRecipeIndex- Lnet/minecraft/screen/MerchantScreenHandler;setRecipeIndex(I)V
 
- 
canUseReturns whether the screen handler can be used.Subclasses should call #canUse(ScreenHandlerContext, PlayerEntity, Block)} or implement the check itself. The implementation should check that the player is near the screen handler's source position (e.g. block position) and that the source (e.g. block) is not destroyed. - Specified by:
- canUsein class- ScreenHandler
- Returns:
- whether the screen handler can be used
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcbf;a(Lbyo;)Z- intermediary - method_7597- Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Z- named - canUse- Lnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
 
- 
getExperiencepublic int getExperience()- Mappings:
- Namespace - Name - Mixin selector - official - l- Lccm;l()I- intermediary - method_19254- Lnet/minecraft/class_1728;method_19254()I- named - getExperience- Lnet/minecraft/screen/MerchantScreenHandler;getExperience()I
 
- 
getMerchantRewardedExperiencepublic int getMerchantRewardedExperience()- Mappings:
- Namespace - Name - Mixin selector - official - m- Lccm;m()I- intermediary - method_19256- Lnet/minecraft/class_1728;method_19256()I- named - getMerchantRewardedExperience- Lnet/minecraft/screen/MerchantScreenHandler;getMerchantRewardedExperience()I
 
- 
setExperienceFromServerpublic void setExperienceFromServer(int experience) - Mappings:
- Namespace - Name - Mixin selector - official - f- Lccm;f(I)V- intermediary - method_19255- Lnet/minecraft/class_1728;method_19255(I)V- named - setExperienceFromServer- Lnet/minecraft/screen/MerchantScreenHandler;setExperienceFromServer(I)V
 
- 
getLevelProgresspublic int getLevelProgress()- Mappings:
- Namespace - Name - Mixin selector - official - n- Lccm;n()I- intermediary - method_19258- Lnet/minecraft/class_1728;method_19258()I- named - getLevelProgress- Lnet/minecraft/screen/MerchantScreenHandler;getLevelProgress()I
 
- 
setLevelProgresspublic void setLevelProgress(int levelProgress) - Mappings:
- Namespace - Name - Mixin selector - official - g- Lccm;g(I)V- intermediary - method_19257- Lnet/minecraft/class_1728;method_19257(I)V- named - setLevelProgress- Lnet/minecraft/screen/MerchantScreenHandler;setLevelProgress(I)V
 
- 
setCanRefreshTradespublic void setCanRefreshTrades(boolean canRefreshTrades) - Mappings:
- Namespace - Name - Mixin selector - official - b- Lccm;b(Z)V- intermediary - method_20700- Lnet/minecraft/class_1728;method_20700(Z)V- named - setCanRefreshTrades- Lnet/minecraft/screen/MerchantScreenHandler;setCanRefreshTrades(Z)V
 
- 
canRefreshTradespublic boolean canRefreshTrades()- Mappings:
- Namespace - Name - Mixin selector - official - o- Lccm;o()Z- intermediary - method_20701- Lnet/minecraft/class_1728;method_20701()Z- named - canRefreshTrades- Lnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades()Z
 
- 
canInsertIntoSlotReturns whetherstackcan be inserted toslot.Subclasses should override this to return falseif the slot is used for output.- Overrides:
- canInsertIntoSlotin class- ScreenHandler
- Returns:
- whether stackcan be inserted toslot
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcbf;a(Lcfz;Lccx;)Z- intermediary - method_7613- Lnet/minecraft/class_1703;method_7613(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;)Z- named - canInsertIntoSlot- Lnet/minecraft/screen/ScreenHandler;canInsertIntoSlot(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;)Z
 
- 
quickMoveQuick-moves the stack atslotto other slots of the screen handler that belong to a different inventory or another section of the same inventory. For example, items can be quick-moved between a chest's slots and the player inventory or between the main player inventory and the hotbar.Subclasses should call ScreenHandler.insertItem(net.minecraft.item.ItemStack, int, int, boolean), and if the insertion was successful, clear the slot (if the stack is exhausted) or mark it as dirty. See the vanilla subclasses for basic implementation.Quick-moving is also known as "shift-clicking" since it's usually triggered using Shift+left click. - Specified by:
- quickMovein class- ScreenHandler
- Parameters:
- slot- the index of the slot to quick-move from
- Returns:
- ItemStack.EMPTYwhen no stack can be transferred, otherwise the original stack
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcbf;a(Lbyo;I)Lcfz;- intermediary - method_7601- Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;- named - quickMove- Lnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
 
- 
playYesSoundprivate void playYesSound()- Mappings:
- Namespace - Name - Mixin selector - official - r- Lccm;r()V- intermediary - method_20595- Lnet/minecraft/class_1728;method_20595()V- named - playYesSound- Lnet/minecraft/screen/MerchantScreenHandler;playYesSound()V
 
- 
onClosedCalled when this screen handler is closed.To close a screen handler, call PlayerEntity.closeHandledScreen()on the server instead of this method.This drops the cursor stack by default. Subclasses that have slots not backed by a persistent inventory should call ScreenHandler.dropInventory(net.minecraft.entity.player.PlayerEntity, net.minecraft.inventory.Inventory)to drop the stacks.- Overrides:
- onClosedin class- ScreenHandler
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcbf;b(Lbyo;)V- intermediary - method_7595- Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)V- named - onClosed- Lnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V
 
- 
switchTopublic void switchTo(int recipeIndex) - Mappings:
- Namespace - Name - Mixin selector - official - h- Lccm;h(I)V- intermediary - method_20215- Lnet/minecraft/class_1728;method_20215(I)V- named - switchTo- Lnet/minecraft/screen/MerchantScreenHandler;switchTo(I)V
 
- 
autofill- Mappings:
- Namespace - Name - Mixin selector - official - c- Lccm;c(ILcfz;)V- intermediary - method_20214- Lnet/minecraft/class_1728;method_20214(ILnet/minecraft/class_1799;)V- named - autofill- Lnet/minecraft/screen/MerchantScreenHandler;autofill(ILnet/minecraft/item/ItemStack;)V
 
- 
setOffers- Mappings:
- Namespace - Name - Mixin selector - official - a- Lccm;a(Lcll;)V- intermediary - method_17437- Lnet/minecraft/class_1728;method_17437(Lnet/minecraft/class_1916;)V- named - setOffers- Lnet/minecraft/screen/MerchantScreenHandler;setOffers(Lnet/minecraft/village/TradeOfferList;)V
 
- 
getRecipes- Mappings:
- Namespace - Name - Mixin selector - official - p- Lccm;p()Lcll;- intermediary - method_17438- Lnet/minecraft/class_1728;method_17438()Lnet/minecraft/class_1916;- named - getRecipes- Lnet/minecraft/screen/MerchantScreenHandler;getRecipes()Lnet/minecraft/village/TradeOfferList;
 
- 
isLeveledpublic boolean isLeveled()- Mappings:
- Namespace - Name - Mixin selector - official - q- Lccm;q()Z- intermediary - method_19259- Lnet/minecraft/class_1728;method_19259()Z- named - isLeveled- Lnet/minecraft/screen/MerchantScreenHandler;isLeveled()Z
 
 
-