Class MerchantScreenHandler
- Mappings:
Namespace Name named net/minecraft/screen/MerchantScreenHandlerintermediary net/minecraft/class_1728official cre
-
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 voidautofill(int slot, TradedItem stack) booleancanInsertIntoSlot(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 named INPUT_1_IDLnet/minecraft/screen/MerchantScreenHandler;INPUT_1_ID:Iintermediary field_30830Lnet/minecraft/class_1728;field_30830:Iofficial kLcre;k:I
-
INPUT_2_ID
protected static final int INPUT_2_ID- See Also:
- Mappings:
Namespace Name Mixin selector named INPUT_2_IDLnet/minecraft/screen/MerchantScreenHandler;INPUT_2_ID:Iintermediary field_30831Lnet/minecraft/class_1728;field_30831:Iofficial lLcre;l:I
-
OUTPUT_ID
protected static final int OUTPUT_ID- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_IDLnet/minecraft/screen/MerchantScreenHandler;OUTPUT_ID:Iintermediary field_30832Lnet/minecraft/class_1728;field_30832:Iofficial mLcre;m:I
-
INVENTORY_START
private static final int INVENTORY_START- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_STARTLnet/minecraft/screen/MerchantScreenHandler;INVENTORY_START:Iintermediary field_30833Lnet/minecraft/class_1728;field_30833:Iofficial nLcre;n:I
-
INVENTORY_END
private static final int INVENTORY_END- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_ENDLnet/minecraft/screen/MerchantScreenHandler;INVENTORY_END:Iintermediary field_30834Lnet/minecraft/class_1728;field_30834:Iofficial oLcre;o:I
-
HOTBAR_START
private static final int HOTBAR_START- See Also:
- Mappings:
Namespace Name Mixin selector named HOTBAR_STARTLnet/minecraft/screen/MerchantScreenHandler;HOTBAR_START:Iintermediary field_30835Lnet/minecraft/class_1728;field_30835:Iofficial pLcre;p:I
-
HOTBAR_END
private static final int HOTBAR_END- See Also:
- Mappings:
Namespace Name Mixin selector named HOTBAR_ENDLnet/minecraft/screen/MerchantScreenHandler;HOTBAR_END:Iintermediary field_30836Lnet/minecraft/class_1728;field_30836:Iofficial qLcre;q:I
-
INPUT_1_X
private static final int INPUT_1_X- See Also:
- Mappings:
Namespace Name Mixin selector named INPUT_1_XLnet/minecraft/screen/MerchantScreenHandler;INPUT_1_X:Iintermediary field_30837Lnet/minecraft/class_1728;field_30837:Iofficial rLcre;r:I
-
INPUT_2_X
private static final int INPUT_2_X- See Also:
- Mappings:
Namespace Name Mixin selector named INPUT_2_XLnet/minecraft/screen/MerchantScreenHandler;INPUT_2_X:Iintermediary field_30838Lnet/minecraft/class_1728;field_30838:Iofficial sLcre;s:I
-
OUTPUT_X
private static final int OUTPUT_X- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_XLnet/minecraft/screen/MerchantScreenHandler;OUTPUT_X:Iintermediary field_30839Lnet/minecraft/class_1728;field_30839:Iofficial tLcre;t:I
-
SLOT_Y
private static final int SLOT_Y- See Also:
- Mappings:
Namespace Name Mixin selector named SLOT_YLnet/minecraft/screen/MerchantScreenHandler;SLOT_Y:Iintermediary field_30840Lnet/minecraft/class_1728;field_30840:Iofficial uLcre;u:I
-
merchant
- Mappings:
Namespace Name Mixin selector named merchantLnet/minecraft/screen/MerchantScreenHandler;merchant:Lnet/minecraft/village/Merchant;intermediary field_7863Lnet/minecraft/class_1728;field_7863:Lnet/minecraft/class_1915;official vLcre;v:Ldbt;
-
merchantInventory
- Mappings:
Namespace Name Mixin selector named merchantInventoryLnet/minecraft/screen/MerchantScreenHandler;merchantInventory:Lnet/minecraft/village/MerchantInventory;intermediary field_7861Lnet/minecraft/class_1728;field_7861:Lnet/minecraft/class_1725;official wLcre;w:Lcrd;
-
levelProgress
private int levelProgress- Mappings:
Namespace Name Mixin selector named levelProgressLnet/minecraft/screen/MerchantScreenHandler;levelProgress:Iintermediary field_18669Lnet/minecraft/class_1728;field_18669:Iofficial xLcre;x:I
-
leveled
private boolean leveled- Mappings:
Namespace Name Mixin selector named leveledLnet/minecraft/screen/MerchantScreenHandler;leveled:Zintermediary field_18670Lnet/minecraft/class_1728;field_18670:Zofficial yLcre;y:Z
-
canRefreshTrades
private boolean canRefreshTrades- Mappings:
Namespace Name Mixin selector named canRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades:Zintermediary field_19358Lnet/minecraft/class_1728;field_19358:Zofficial zLcre;z:Z
-
-
Constructor Details
-
MerchantScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)Vintermediary <init>Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;)Vofficial <init>Lcre;<init>(ILcmw;)V
-
MerchantScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/MerchantScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/village/Merchant;)Vintermediary <init>Lnet/minecraft/class_1728;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_1915;)Vofficial <init>Lcre;<init>(ILcmw;Ldbt;)V
-
-
Method Details
-
setLeveled
public void setLeveled(boolean leveled) - Mappings:
Namespace Name Mixin selector named setLeveledLnet/minecraft/screen/MerchantScreenHandler;setLeveled(Z)Vintermediary method_19253Lnet/minecraft/class_1728;method_19253(Z)Vofficial aLcre;a(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 named onContentChangedLnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)Vintermediary method_7609Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)Vofficial aLcpu;a(Lbqk;)V
-
setRecipeIndex
public void setRecipeIndex(int index) - Mappings:
Namespace Name Mixin selector named setRecipeIndexLnet/minecraft/screen/MerchantScreenHandler;setRecipeIndex(I)Vintermediary method_7650Lnet/minecraft/class_1728;method_7650(I)Vofficial eLcre;e(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 named canUseLnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_7597Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Zofficial bLcpu;b(Lcmx;)Z
-
getExperience
public int getExperience()- Mappings:
Namespace Name Mixin selector named getExperienceLnet/minecraft/screen/MerchantScreenHandler;getExperience()Iintermediary method_19254Lnet/minecraft/class_1728;method_19254()Iofficial lLcre;l()I
-
getMerchantRewardedExperience
public int getMerchantRewardedExperience()- Mappings:
Namespace Name Mixin selector named getMerchantRewardedExperienceLnet/minecraft/screen/MerchantScreenHandler;getMerchantRewardedExperience()Iintermediary method_19256Lnet/minecraft/class_1728;method_19256()Iofficial mLcre;m()I
-
setExperienceFromServer
public void setExperienceFromServer(int experience) - Mappings:
Namespace Name Mixin selector named setExperienceFromServerLnet/minecraft/screen/MerchantScreenHandler;setExperienceFromServer(I)Vintermediary method_19255Lnet/minecraft/class_1728;method_19255(I)Vofficial fLcre;f(I)V
-
getLevelProgress
public int getLevelProgress()- Mappings:
Namespace Name Mixin selector named getLevelProgressLnet/minecraft/screen/MerchantScreenHandler;getLevelProgress()Iintermediary method_19258Lnet/minecraft/class_1728;method_19258()Iofficial nLcre;n()I
-
setLevelProgress
public void setLevelProgress(int levelProgress) - Mappings:
Namespace Name Mixin selector named setLevelProgressLnet/minecraft/screen/MerchantScreenHandler;setLevelProgress(I)Vintermediary method_19257Lnet/minecraft/class_1728;method_19257(I)Vofficial gLcre;g(I)V
-
setCanRefreshTrades
public void setCanRefreshTrades(boolean canRefreshTrades) - Mappings:
Namespace Name Mixin selector named setCanRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;setCanRefreshTrades(Z)Vintermediary method_20700Lnet/minecraft/class_1728;method_20700(Z)Vofficial bLcre;b(Z)V
-
canRefreshTrades
public boolean canRefreshTrades()- Mappings:
Namespace Name Mixin selector named canRefreshTradesLnet/minecraft/screen/MerchantScreenHandler;canRefreshTrades()Zintermediary method_20701Lnet/minecraft/class_1728;method_20701()Zofficial oLcre;o()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 named canInsertIntoSlotLnet/minecraft/screen/ScreenHandler;canInsertIntoSlot(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;)Zintermediary method_7613Lnet/minecraft/class_1703;method_7613(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;)Zofficial aLcpu;a(Lcuq;Lcrq;)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 named quickMoveLnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;intermediary method_7601Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;official bLcpu;b(Lcmx;I)Lcuq;
-
playYesSound
private void playYesSound()- Mappings:
Namespace Name Mixin selector named playYesSoundLnet/minecraft/screen/MerchantScreenHandler;playYesSound()Vintermediary method_20595Lnet/minecraft/class_1728;method_20595()Vofficial rLcre;r()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 named onClosedLnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_7595Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)Vofficial aLcpu;a(Lcmx;)V
-
switchTo
public void switchTo(int recipeIndex) - Mappings:
Namespace Name Mixin selector named switchToLnet/minecraft/screen/MerchantScreenHandler;switchTo(I)Vintermediary method_20215Lnet/minecraft/class_1728;method_20215(I)Vofficial hLcre;h(I)V
-
autofill
- Mappings:
Namespace Name Mixin selector named autofillLnet/minecraft/screen/MerchantScreenHandler;autofill(ILnet/minecraft/village/TradedItem;)Vintermediary method_20214Lnet/minecraft/class_1728;method_20214(ILnet/minecraft/class_9306;)Vofficial aLcre;a(ILdbs;)V
-
setOffers
- Mappings:
Namespace Name Mixin selector named setOffersLnet/minecraft/screen/MerchantScreenHandler;setOffers(Lnet/minecraft/village/TradeOfferList;)Vintermediary method_17437Lnet/minecraft/class_1728;method_17437(Lnet/minecraft/class_1916;)Vofficial aLcre;a(Ldbv;)V
-
getRecipes
- Mappings:
Namespace Name Mixin selector named getRecipesLnet/minecraft/screen/MerchantScreenHandler;getRecipes()Lnet/minecraft/village/TradeOfferList;intermediary method_17438Lnet/minecraft/class_1728;method_17438()Lnet/minecraft/class_1916;official pLcre;p()Ldbv;
-
isLeveled
public boolean isLeveled()- Mappings:
Namespace Name Mixin selector named isLeveledLnet/minecraft/screen/MerchantScreenHandler;isLeveled()Zintermediary method_19259Lnet/minecraft/class_1728;method_19259()Zofficial qLcre;q()Z
-