Class MerchantScreenHandler
- Mappings:
Namespace Name official cckintermediary net/minecraft/class_1728named net/minecraft/screen/MerchantScreenHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprotected static final intprotected static final intprotected static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate booleanprivate intprivate final Merchantprivate final MerchantInventoryFields 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
-
field_30830
protected static final int field_30830- See Also:
- Mappings:
Namespace Name Mixin selector official kLcck;k:Iintermediary field_30830Lnet/minecraft/class_1728;field_30830:Inamed field_30830Lnet/minecraft/screen/MerchantScreenHandler;field_30830:I
-
field_30831
protected static final int field_30831- See Also:
- Mappings:
Namespace Name Mixin selector official lLcck;l:Iintermediary field_30831Lnet/minecraft/class_1728;field_30831:Inamed field_30831Lnet/minecraft/screen/MerchantScreenHandler;field_30831:I
-
field_30832
protected static final int field_30832- See Also:
- Mappings:
Namespace Name Mixin selector official mLcck;m:Iintermediary field_30832Lnet/minecraft/class_1728;field_30832:Inamed field_30832Lnet/minecraft/screen/MerchantScreenHandler;field_30832:I
-
field_30833
private static final int field_30833- See Also:
- Mappings:
Namespace Name Mixin selector official nLcck;n:Iintermediary field_30833Lnet/minecraft/class_1728;field_30833:Inamed field_30833Lnet/minecraft/screen/MerchantScreenHandler;field_30833:I
-
field_30834
private static final int field_30834- See Also:
- Mappings:
Namespace Name Mixin selector official oLcck;o:Iintermediary field_30834Lnet/minecraft/class_1728;field_30834:Inamed field_30834Lnet/minecraft/screen/MerchantScreenHandler;field_30834:I
-
field_30835
private static final int field_30835- See Also:
- Mappings:
Namespace Name Mixin selector official pLcck;p:Iintermediary field_30835Lnet/minecraft/class_1728;field_30835:Inamed field_30835Lnet/minecraft/screen/MerchantScreenHandler;field_30835:I
-
field_30836
private static final int field_30836- See Also:
- Mappings:
Namespace Name Mixin selector official qLcck;q:Iintermediary field_30836Lnet/minecraft/class_1728;field_30836:Inamed field_30836Lnet/minecraft/screen/MerchantScreenHandler;field_30836:I
-
field_30837
private static final int field_30837- See Also:
- Mappings:
Namespace Name Mixin selector official rLcck;r:Iintermediary field_30837Lnet/minecraft/class_1728;field_30837:Inamed field_30837Lnet/minecraft/screen/MerchantScreenHandler;field_30837:I
-
field_30838
private static final int field_30838- See Also:
- Mappings:
Namespace Name Mixin selector official sLcck;s:Iintermediary field_30838Lnet/minecraft/class_1728;field_30838:Inamed field_30838Lnet/minecraft/screen/MerchantScreenHandler;field_30838:I
-
field_30839
private static final int field_30839- See Also:
- Mappings:
Namespace Name Mixin selector official tLcck;t:Iintermediary field_30839Lnet/minecraft/class_1728;field_30839:Inamed field_30839Lnet/minecraft/screen/MerchantScreenHandler;field_30839:I
-
field_30840
private static final int field_30840- See Also:
- Mappings:
Namespace Name Mixin selector official uLcck;u:Iintermediary field_30840Lnet/minecraft/class_1728;field_30840:Inamed field_30840Lnet/minecraft/screen/MerchantScreenHandler;field_30840:I
-
merchant
- Mappings:
Namespace Name Mixin selector official vLcck;v:Lclh;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 wLcck;w:Lccj;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 xLcck;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 yLcck;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 zLcck;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>Lcck;<init>(ILbyl;)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>Lcck;<init>(ILbyl;Lclh;)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 aLcck;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 aLcbd;a(Lbdp;)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 eLcck;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 aLcbd;a(Lbym;)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 lLcck;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 mLcck;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 fLcck;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 nLcck;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 gLcck;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 bLcck;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 oLcck;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 aLcbd;a(Lcfx;Lccv;)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 aLcbd;a(Lbym;I)Lcfx;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 rLcck;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 bLcbd;b(Lbym;)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 hLcck;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 cLcck;c(ILcfx;)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 aLcck;a(Lclj;)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 pLcck;p()Lclj;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 qLcck;q()Zintermediary method_19259Lnet/minecraft/class_1728;method_19259()Znamed isLeveledLnet/minecraft/screen/MerchantScreenHandler;isLeveled()Z
-