Class MerchantScreenHandler
- Mappings:
Namespace Name official cfjintermediary net/minecraft/class_1728named net/minecraft/screen/MerchantScreenHandler
-
Field Summary
FieldsModifier 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.ScreenHandler
EMPTY_SPACE_SLOT_INDEX, field_30731, field_30732, field_30733, field_30734, field_30735, field_30736, field_30737, slots, syncId -
Constructor Summary
ConstructorsConstructorDescriptionMerchantScreenHandler(int syncId, PlayerInventory playerInventory) MerchantScreenHandler(int syncId, PlayerInventory playerInventory, Merchant merchant) -
Method Summary
Modifier 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.ScreenHandler
addListener, 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_ID
protected static final int INPUT_1_ID- See Also:
- Mappings:
Namespace Name Mixin selector official kLcfj;k:Iintermediary field_30830Lnet/minecraft/class_1728;field_30830:Inamed INPUT_1_IDLnet/minecraft/screen/MerchantScreenHandler;INPUT_1_ID:I
-
INPUT_2_ID
protected static final int INPUT_2_ID- See Also:
- Mappings:
Namespace Name Mixin selector official lLcfj;l:Iintermediary field_30831Lnet/minecraft/class_1728;field_30831:Inamed INPUT_2_IDLnet/minecraft/screen/MerchantScreenHandler;INPUT_2_ID:I
-
OUTPUT_ID
protected static final int OUTPUT_ID- See Also:
- Mappings:
Namespace Name Mixin selector official mLcfj;m:Iintermediary field_30832Lnet/minecraft/class_1728;field_30832:Inamed OUTPUT_IDLnet/minecraft/screen/MerchantScreenHandler;OUTPUT_ID:I
-
INVENTORY_START
private static final int INVENTORY_START- See Also:
- Mappings:
Namespace Name Mixin selector official nLcfj;n:Iintermediary field_30833Lnet/minecraft/class_1728;field_30833:Inamed INVENTORY_STARTLnet/minecraft/screen/MerchantScreenHandler;INVENTORY_START:I
-
INVENTORY_END
private static final int INVENTORY_END- See Also:
- Mappings:
Namespace Name Mixin selector official oLcfj;o:Iintermediary field_30834Lnet/minecraft/class_1728;field_30834:Inamed INVENTORY_ENDLnet/minecraft/screen/MerchantScreenHandler;INVENTORY_END:I
-
HOTBAR_START
private static final int HOTBAR_START- See Also:
- Mappings:
Namespace Name Mixin selector official pLcfj;p:Iintermediary field_30835Lnet/minecraft/class_1728;field_30835:Inamed HOTBAR_STARTLnet/minecraft/screen/MerchantScreenHandler;HOTBAR_START:I
-
HOTBAR_END
private static final int HOTBAR_END- See Also:
- Mappings:
Namespace Name Mixin selector official qLcfj;q:Iintermediary field_30836Lnet/minecraft/class_1728;field_30836:Inamed HOTBAR_ENDLnet/minecraft/screen/MerchantScreenHandler;HOTBAR_END:I
-
INPUT_1_X
private static final int INPUT_1_X- See Also:
- Mappings:
Namespace Name Mixin selector official rLcfj;r:Iintermediary field_30837Lnet/minecraft/class_1728;field_30837:Inamed INPUT_1_XLnet/minecraft/screen/MerchantScreenHandler;INPUT_1_X:I
-
INPUT_2_X
private static final int INPUT_2_X- See Also:
- Mappings:
Namespace Name Mixin selector official sLcfj;s:Iintermediary field_30838Lnet/minecraft/class_1728;field_30838:Inamed INPUT_2_XLnet/minecraft/screen/MerchantScreenHandler;INPUT_2_X:I
-
OUTPUT_X
private static final int OUTPUT_X- See Also:
- Mappings:
Namespace Name Mixin selector official tLcfj;t:Iintermediary field_30839Lnet/minecraft/class_1728;field_30839:Inamed OUTPUT_XLnet/minecraft/screen/MerchantScreenHandler;OUTPUT_X:I
-
SLOT_Y
private static final int SLOT_Y- See Also:
- Mappings:
Namespace Name Mixin selector official uLcfj;u:Iintermediary field_30840Lnet/minecraft/class_1728;field_30840:Inamed SLOT_YLnet/minecraft/screen/MerchantScreenHandler;SLOT_Y:I
-
merchant
- Mappings:
Namespace Name Mixin selector official vLcfj;v:Lcog;intermediary field_7863Lnet/minecraft/class_1728;field_7863:Lnet/minecraft/class_1915;named merchantLnet/minecraft/screen/MerchantScreenHandler;merchant:Lnet/minecraft/village/Merchant;
-
merchantInventory
- Mappings:
Namespace Name Mixin selector official wLcfj;w:Lcfi;intermediary field_7861Lnet/minecraft/class_1728;field_7861:Lnet/minecraft/class_1725;named merchantInventoryLnet/minecraft/screen/MerchantScreenHandler;merchantInventory:Lnet/minecraft/village/MerchantInventory;
-
levelProgress
private int levelProgress- Mappings:
Namespace Name Mixin selector official xLcfj;x:Iintermediary field_18669Lnet/minecraft/class_1728;field_18669:Inamed levelProgressLnet/minecraft/screen/MerchantScreenHandler;levelProgress:I
-
leveled
private boolean leveled- Mappings:
Namespace Name Mixin selector official yLcfj;y:Zintermediary field_18670Lnet/minecraft/class_1728;field_18670:Znamed leveledLnet/minecraft/screen/MerchantScreenHandler;leveled:Z
-
canRefreshTrades
private boolean canRefreshTrades- Mappings:
Namespace Name Mixin selector official zLcfj;z:Zintermediary field_19358Lnet/minecraft/class_1728;field_19358:Znamed canRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades:Z
-
-
Constructor Details
-
MerchantScreenHandler
- Mappings:
Namespace Name Mixin selector official <init>Lcfj;<init>(ILcbk;)Vintermediary <init>Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;)Vnamed <init>Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
-
MerchantScreenHandler
- Mappings:
Namespace Name Mixin selector official <init>Lcfj;<init>(ILcbk;Lcog;)Vintermediary <init>Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_1915;)Vnamed <init>Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/village/Merchant;)V
-
-
Method Details
-
setLeveled
public void setLeveled(boolean leveled) - Mappings:
Namespace Name Mixin selector official aLcfj;a(Z)Vintermediary method_19253Lnet/minecraft/class_1728;method_19253(Z)Vnamed setLeveledLnet/minecraft/screen/MerchantScreenHandler;setLeveled(Z)V
-
onContentChanged
Called 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 classScreenHandler- Mappings:
Namespace Name Mixin selector official aLcec;a(Lbgh;)Vintermediary method_7609Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)Vnamed onContentChangedLnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
-
setRecipeIndex
public void setRecipeIndex(int index) - Mappings:
Namespace Name Mixin selector official eLcfj;e(I)Vintermediary method_7650Lnet/minecraft/class_1728;method_7650(I)Vnamed setRecipeIndexLnet/minecraft/screen/MerchantScreenHandler;setRecipeIndex(I)V
-
canUse
Returns 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 classScreenHandler- Returns:
- whether the screen handler can be used
- Mappings:
Namespace Name Mixin selector official aLcec;a(Lcbl;)Zintermediary method_7597Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Znamed canUseLnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
getExperience
public int getExperience()- Mappings:
Namespace Name Mixin selector official lLcfj;l()Iintermediary method_19254Lnet/minecraft/class_1728;method_19254()Inamed getExperienceLnet/minecraft/screen/MerchantScreenHandler;getExperience()I
-
getMerchantRewardedExperience
public int getMerchantRewardedExperience()- Mappings:
Namespace Name Mixin selector official mLcfj;m()Iintermediary method_19256Lnet/minecraft/class_1728;method_19256()Inamed getMerchantRewardedExperienceLnet/minecraft/screen/MerchantScreenHandler;getMerchantRewardedExperience()I
-
setExperienceFromServer
public void setExperienceFromServer(int experience) - Mappings:
Namespace Name Mixin selector official fLcfj;f(I)Vintermediary method_19255Lnet/minecraft/class_1728;method_19255(I)Vnamed setExperienceFromServerLnet/minecraft/screen/MerchantScreenHandler;setExperienceFromServer(I)V
-
getLevelProgress
public int getLevelProgress()- Mappings:
Namespace Name Mixin selector official nLcfj;n()Iintermediary method_19258Lnet/minecraft/class_1728;method_19258()Inamed getLevelProgressLnet/minecraft/screen/MerchantScreenHandler;getLevelProgress()I
-
setLevelProgress
public void setLevelProgress(int levelProgress) - Mappings:
Namespace Name Mixin selector official gLcfj;g(I)Vintermediary method_19257Lnet/minecraft/class_1728;method_19257(I)Vnamed setLevelProgressLnet/minecraft/screen/MerchantScreenHandler;setLevelProgress(I)V
-
setCanRefreshTrades
public void setCanRefreshTrades(boolean canRefreshTrades) - Mappings:
Namespace Name Mixin selector official bLcfj;b(Z)Vintermediary method_20700Lnet/minecraft/class_1728;method_20700(Z)Vnamed setCanRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;setCanRefreshTrades(Z)V
-
canRefreshTrades
public boolean canRefreshTrades()- Mappings:
Namespace Name Mixin selector official oLcfj;o()Zintermediary method_20701Lnet/minecraft/class_1728;method_20701()Znamed canRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades()Z
-
canInsertIntoSlot
Returns whetherstackcan be inserted toslot.Subclasses should override this to return
falseif the slot is used for output.- Overrides:
canInsertIntoSlotin classScreenHandler- Returns:
- whether
stackcan be inserted toslot - Mappings:
Namespace Name Mixin selector official aLcec;a(Lciw;Lcfu;)Zintermediary method_7613Lnet/minecraft/class_1703;method_7613(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;)Znamed canInsertIntoSlotLnet/minecraft/screen/ScreenHandler;canInsertIntoSlot(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;)Z
-
quickMove
Quick-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 classScreenHandler- 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 aLcec;a(Lcbl;I)Lciw;intermediary method_7601Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;named quickMoveLnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
-
playYesSound
private void playYesSound()- Mappings:
Namespace Name Mixin selector official rLcfj;r()Vintermediary method_20595Lnet/minecraft/class_1728;method_20595()Vnamed playYesSoundLnet/minecraft/screen/MerchantScreenHandler;playYesSound()V
-
onClosed
Called 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 classScreenHandler- Mappings:
Namespace Name Mixin selector official bLcec;b(Lcbl;)Vintermediary method_7595Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)Vnamed onClosedLnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V
-
switchTo
public void switchTo(int recipeIndex) - Mappings:
Namespace Name Mixin selector official hLcfj;h(I)Vintermediary method_20215Lnet/minecraft/class_1728;method_20215(I)Vnamed switchToLnet/minecraft/screen/MerchantScreenHandler;switchTo(I)V
-
autofill
- Mappings:
Namespace Name Mixin selector official cLcfj;c(ILciw;)Vintermediary method_20214Lnet/minecraft/class_1728;method_20214(ILnet/minecraft/class_1799;)Vnamed autofillLnet/minecraft/screen/MerchantScreenHandler;autofill(ILnet/minecraft/item/ItemStack;)V
-
setOffers
- Mappings:
Namespace Name Mixin selector official aLcfj;a(Lcoi;)Vintermediary method_17437Lnet/minecraft/class_1728;method_17437(Lnet/minecraft/class_1916;)Vnamed setOffersLnet/minecraft/screen/MerchantScreenHandler;setOffers(Lnet/minecraft/village/TradeOfferList;)V
-
getRecipes
- Mappings:
Namespace Name Mixin selector official pLcfj;p()Lcoi;intermediary method_17438Lnet/minecraft/class_1728;method_17438()Lnet/minecraft/class_1916;named getRecipesLnet/minecraft/screen/MerchantScreenHandler;getRecipes()Lnet/minecraft/village/TradeOfferList;
-
isLeveled
public boolean isLeveled()- Mappings:
Namespace Name Mixin selector official qLcfj;q()Zintermediary method_19259Lnet/minecraft/class_1728;method_19259()Znamed isLeveledLnet/minecraft/screen/MerchantScreenHandler;isLeveled()Z
-