Class StonecutterScreenHandler
- Mappings:
Namespace Name named net/minecraft/screen/StonecutterScreenHandlerintermediary net/minecraft/class_3971official cug
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Runnableprivate final ScreenHandlerContextfinal Inventorystatic final int(package private) final Slotprivate ItemStackprivate static final intprivate static final int(package private) long(package private) final CraftingResultInventoryprivate static final intstatic final intprivate static final int(package private) final Slot(package private) final Propertyprivate final WorldFields 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, field_52557, field_52558, slots, syncId -
Constructor Summary
ConstructorsConstructorDescriptionStonecutterScreenHandler(int syncId, PlayerInventory playerInventory) StonecutterScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCraft()booleancanInsertIntoSlot(ItemStack stack, Slot slot) Returns whetherstackcan be inserted toslot.booleancanUse(PlayerEntity player) Returns whether the screen handler can be used.intintgetType()Returns the screen handler type.private booleanisInBounds(int id) booleanonButtonClick(PlayerEntity player, int id) Called whenplayerclicks a button withid.voidonClosed(PlayerEntity player) Called when this screen handler is closed.voidonContentChanged(Inventory inventory) Called when a slot's content has changed.(package private) voidpopulateResult(int selectedId) quickMove(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.voidsetContentsChangedListener(Runnable contentsChangedListener) private voidupdateInput(ItemStack stack) Methods inherited from class net.minecraft.screen.ScreenHandler
addListener, addPlayerHotbarSlots, addPlayerInventorySlots, addPlayerSlots, addProperties, addProperty, addSlot, calculateComparatorOutput, calculateComparatorOutput, calculateStackSize, canInsertIntoSlot, canInsertItemIntoSlot, canUse, checkDataCount, checkSize, copySharedSlots, disableSyncing, dropInventory, enableSyncing, endQuickCraft, getCursorStack, getRevision, getSlot, getSlotIndex, getStacks, insertItem, isValid, nextRevision, onSlotClick, packQuickCraftData, removeListener, selectBundleStack, sendContentUpdates, setCursorStack, setPreviousCursorStack, setPreviousTrackedSlot, setPreviousTrackedSlotMutable, setProperty, setStackInSlot, shouldQuickCraftContinue, syncState, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks, updateSyncHandler, updateToClient
-
Field Details
-
INPUT_ID
public static final int INPUT_ID- See Also:
- Mappings:
Namespace Name Mixin selector named INPUT_IDLnet/minecraft/screen/StonecutterScreenHandler;INPUT_ID:Iintermediary field_30842Lnet/minecraft/class_3971;field_30842:Iofficial mLcug;m:I
-
OUTPUT_ID
public static final int OUTPUT_ID- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_IDLnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_ID:Iintermediary field_30843Lnet/minecraft/class_3971;field_30843:Iofficial nLcug;n:I
-
INVENTORY_START
private static final int INVENTORY_START- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_STARTLnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_START:Iintermediary field_30844Lnet/minecraft/class_3971;field_30844:Iofficial rLcug;r:I
-
INVENTORY_END
private static final int INVENTORY_END- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_ENDLnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_END:Iintermediary field_30845Lnet/minecraft/class_3971;field_30845:Iofficial sLcug;s:I
-
OUTPUT_START
private static final int OUTPUT_START- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_STARTLnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_START:Iintermediary field_30846Lnet/minecraft/class_3971;field_30846:Iofficial tLcug;t:I
-
OUTPUT_END
private static final int OUTPUT_END- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_ENDLnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_END:Iintermediary field_30847Lnet/minecraft/class_3971;field_30847:Iofficial uLcug;u:I
-
context
- Mappings:
Namespace Name Mixin selector named contextLnet/minecraft/screen/StonecutterScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;intermediary field_17630Lnet/minecraft/class_3971;field_17630:Lnet/minecraft/class_3914;official vLcug;v:Lcsq;
-
selectedRecipe
- Mappings:
Namespace Name Mixin selector named selectedRecipeLnet/minecraft/screen/StonecutterScreenHandler;selectedRecipe:Lnet/minecraft/screen/Property;intermediary field_17631Lnet/minecraft/class_3971;field_17631:Lnet/minecraft/class_3915;official wLcug;w:Lcsx;
-
world
- Mappings:
Namespace Name Mixin selector named worldLnet/minecraft/screen/StonecutterScreenHandler;world:Lnet/minecraft/world/World;intermediary field_17632Lnet/minecraft/class_3971;field_17632:Lnet/minecraft/class_1937;official xLcug;x:Ldgj;
-
availableRecipes
- Mappings:
Namespace Name Mixin selector named availableRecipesLnet/minecraft/screen/StonecutterScreenHandler;availableRecipes:Lnet/minecraft/recipe/display/CuttingRecipeDisplay$Grouping;intermediary field_54600Lnet/minecraft/class_3971;field_54600:Lnet/minecraft/class_10291$class_10293;official yLcug;y:Ldbs$b;
-
inputStack
- Mappings:
Namespace Name Mixin selector named inputStackLnet/minecraft/screen/StonecutterScreenHandler;inputStack:Lnet/minecraft/item/ItemStack;intermediary field_17634Lnet/minecraft/class_3971;field_17634:Lnet/minecraft/class_1799;official zLcug;z:Lcwq;
-
lastTakeTime
long lastTakeTime- Mappings:
Namespace Name Mixin selector named lastTakeTimeLnet/minecraft/screen/StonecutterScreenHandler;lastTakeTime:Jintermediary field_17635Lnet/minecraft/class_3971;field_17635:Jofficial ALcug;A:J
-
inputSlot
- Mappings:
Namespace Name Mixin selector named inputSlotLnet/minecraft/screen/StonecutterScreenHandler;inputSlot:Lnet/minecraft/screen/slot/Slot;intermediary field_17627Lnet/minecraft/class_3971;field_17627:Lnet/minecraft/class_1735;official oLcug;o:Lcua;
-
outputSlot
- Mappings:
Namespace Name Mixin selector named outputSlotLnet/minecraft/screen/StonecutterScreenHandler;outputSlot:Lnet/minecraft/screen/slot/Slot;intermediary field_17628Lnet/minecraft/class_3971;field_17628:Lnet/minecraft/class_1735;official pLcug;p:Lcua;
-
contentsChangedListener
Runnable contentsChangedListener- Mappings:
Namespace Name Mixin selector named contentsChangedListenerLnet/minecraft/screen/StonecutterScreenHandler;contentsChangedListener:Ljava/lang/Runnable;intermediary field_17636Lnet/minecraft/class_3971;field_17636:Ljava/lang/Runnable;official BLcug;B:Ljava/lang/Runnable;
-
input
- Mappings:
Namespace Name Mixin selector named inputLnet/minecraft/screen/StonecutterScreenHandler;input:Lnet/minecraft/inventory/Inventory;intermediary field_17629Lnet/minecraft/class_3971;field_17629:Lnet/minecraft/class_1263;official qLcug;q:Lbse;
-
output
- Mappings:
Namespace Name Mixin selector named outputLnet/minecraft/screen/StonecutterScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;intermediary field_19173Lnet/minecraft/class_3971;field_19173:Lnet/minecraft/class_1731;official CLcug;C:Lctv;
-
-
Constructor Details
-
StonecutterScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/StonecutterScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)Vintermediary <init>Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;)Vofficial <init>Lcug;<init>(ILcox;)V
-
StonecutterScreenHandler
public StonecutterScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/StonecutterScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)Vintermediary <init>Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)Vofficial <init>Lcug;<init>(ILcox;Lcsq;)V
-
-
Method Details
-
getSelectedRecipe
public int getSelectedRecipe()- Mappings:
Namespace Name Mixin selector named getSelectedRecipeLnet/minecraft/screen/StonecutterScreenHandler;getSelectedRecipe()Iintermediary method_17862Lnet/minecraft/class_3971;method_17862()Iofficial lLcug;l()I
-
getAvailableRecipes
- Mappings:
Namespace Name Mixin selector named getAvailableRecipesLnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipes()Lnet/minecraft/recipe/display/CuttingRecipeDisplay$Grouping;intermediary method_17863Lnet/minecraft/class_3971;method_17863()Lnet/minecraft/class_10291$class_10293;official mLcug;m()Ldbs$b;
-
getAvailableRecipeCount
public int getAvailableRecipeCount()- Mappings:
Namespace Name Mixin selector named getAvailableRecipeCountLnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipeCount()Iintermediary method_17864Lnet/minecraft/class_3971;method_17864()Iofficial nLcug;n()I
-
canCraft
public boolean canCraft()- Mappings:
Namespace Name Mixin selector named canCraftLnet/minecraft/screen/StonecutterScreenHandler;canCraft()Zintermediary method_17865Lnet/minecraft/class_3971;method_17865()Zofficial oLcug;o()Z
-
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 bLcsd;b(Lcoy;)Z
-
onButtonClick
Called whenplayerclicks a button withid."Button click" is an abstract concept; it does not have to be triggered by a button. Examples of button clicks include selecting a recipe for a stonecutter, turning a page of a lectern's book, or selecting an enchantment on an enchanting table. Buttons are identified by an integer.
- Overrides:
onButtonClickin classScreenHandler- Returns:
- whether the button click is handled successfully
- Implementation Note:
- This is normally only called by the server; however, screens that use buttons can call this on the client.
- Mappings:
Namespace Name Mixin selector named onButtonClickLnet/minecraft/screen/ScreenHandler;onButtonClick(Lnet/minecraft/entity/player/PlayerEntity;I)Zintermediary method_7604Lnet/minecraft/class_1703;method_7604(Lnet/minecraft/class_1657;I)Zofficial aLcsd;a(Lcoy;I)Z
-
isInBounds
private boolean isInBounds(int id) - Mappings:
Namespace Name Mixin selector named isInBoundsLnet/minecraft/screen/StonecutterScreenHandler;isInBounds(I)Zintermediary method_30160Lnet/minecraft/class_3971;method_30160(I)Zofficial eLcug;e(I)Z
-
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 aLcsd;a(Lbse;)V
-
updateInput
- Mappings:
Namespace Name Mixin selector named updateInputLnet/minecraft/screen/StonecutterScreenHandler;updateInput(Lnet/minecraft/item/ItemStack;)Vintermediary method_17855Lnet/minecraft/class_3971;method_17855(Lnet/minecraft/class_1799;)Vofficial cLcug;c(Lcwq;)V
-
populateResult
void populateResult(int selectedId) - Mappings:
Namespace Name Mixin selector named populateResultLnet/minecraft/screen/StonecutterScreenHandler;populateResult(I)Vintermediary method_17866Lnet/minecraft/class_3971;method_17866(I)Vofficial fLcug;f(I)V
-
getType
Returns the screen handler type.A screen handler must have associated screen handler type to open it.
- Overrides:
getTypein classScreenHandler- Returns:
- the screen handler type
- Throws:
UnsupportedOperationException- if the type is not passed in the constructor- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/screen/ScreenHandler;getType()Lnet/minecraft/screen/ScreenHandlerType;intermediary method_17358Lnet/minecraft/class_1703;method_17358()Lnet/minecraft/class_3917;official aLcsd;a()Lctm;
-
setContentsChangedListener
- Mappings:
Namespace Name Mixin selector named setContentsChangedListenerLnet/minecraft/screen/StonecutterScreenHandler;setContentsChangedListener(Ljava/lang/Runnable;)Vintermediary method_17859Lnet/minecraft/class_3971;method_17859(Ljava/lang/Runnable;)Vofficial aLcug;a(Ljava/lang/Runnable;)V
-
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 aLcsd;a(Lcwq;Lcua;)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 bLcsd;b(Lcoy;I)Lcwq;
-
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 aLcsd;a(Lcoy;)V
-