Class StonecutterScreenHandler
- Mappings:
Namespace Name named net/minecraft/screen/StonecutterScreenHandler
intermediary net/minecraft/class_3971
official cru
-
Field Summary
Modifier and TypeFieldDescriptionprivate List
<RecipeEntry<StonecuttingRecipe>> (package private) Runnable
private final ScreenHandlerContext
final Inventory
static final int
(package private) final Slot
private ItemStack
private static final int
private static final int
(package private) long
(package private) final CraftingResultInventory
private static final int
static final int
private static final int
(package private) final Slot
private final Property
private final World
Fields 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
ConstructorDescriptionStonecutterScreenHandler
(int syncId, PlayerInventory playerInventory) StonecutterScreenHandler
(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCraft()
boolean
canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
canUse
(PlayerEntity player) Returns whether the screen handler can be used.private static SingleStackRecipeInput
createRecipeInput
(Inventory inventory) int
int
getType()
Returns the screen handler type.private boolean
isInBounds
(int id) boolean
onButtonClick
(PlayerEntity player, int id) Called whenplayer
clicks a button withid
.void
onClosed
(PlayerEntity player) Called when this screen handler is closed.void
onContentChanged
(Inventory inventory) Called when a slot's content has changed.(package private) void
quickMove
(PlayerEntity player, int slot) Quick-moves the stack atslot
to other slots of the screen handler that belong to a different inventory or another section of the same inventory.void
setContentsChangedListener
(Runnable contentsChangedListener) private void
updateInput
(Inventory input, ItemStack stack) 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, insertItem, isValid, nextRevision, onSlotClick, packQuickCraftData, removeListener, 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_ID
Lnet/minecraft/screen/StonecutterScreenHandler;INPUT_ID:I
intermediary field_30842
Lnet/minecraft/class_3971;field_30842:I
official k
Lcru;k:I
-
OUTPUT_ID
public static final int OUTPUT_ID- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_ID
Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_ID:I
intermediary field_30843
Lnet/minecraft/class_3971;field_30843:I
official l
Lcru;l:I
-
INVENTORY_START
private static final int INVENTORY_START- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_START
Lnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_START:I
intermediary field_30844
Lnet/minecraft/class_3971;field_30844:I
official p
Lcru;p:I
-
INVENTORY_END
private static final int INVENTORY_END- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_END
Lnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_END:I
intermediary field_30845
Lnet/minecraft/class_3971;field_30845:I
official q
Lcru;q:I
-
OUTPUT_START
private static final int OUTPUT_START- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_START
Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_START:I
intermediary field_30846
Lnet/minecraft/class_3971;field_30846:I
official r
Lcru;r:I
-
OUTPUT_END
private static final int OUTPUT_END- See Also:
- Mappings:
Namespace Name Mixin selector named OUTPUT_END
Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_END:I
intermediary field_30847
Lnet/minecraft/class_3971;field_30847:I
official s
Lcru;s:I
-
context
- Mappings:
Namespace Name Mixin selector named context
Lnet/minecraft/screen/StonecutterScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
intermediary field_17630
Lnet/minecraft/class_3971;field_17630:Lnet/minecraft/class_3914;
official t
Lcru;t:Lcqe;
-
selectedRecipe
- Mappings:
Namespace Name Mixin selector named selectedRecipe
Lnet/minecraft/screen/StonecutterScreenHandler;selectedRecipe:Lnet/minecraft/screen/Property;
intermediary field_17631
Lnet/minecraft/class_3971;field_17631:Lnet/minecraft/class_3915;
official u
Lcru;u:Lcql;
-
world
- Mappings:
Namespace Name Mixin selector named world
Lnet/minecraft/screen/StonecutterScreenHandler;world:Lnet/minecraft/world/World;
intermediary field_17632
Lnet/minecraft/class_3971;field_17632:Lnet/minecraft/class_1937;
official v
Lcru;v:Ldcu;
-
availableRecipes
- Mappings:
Namespace Name Mixin selector named availableRecipes
Lnet/minecraft/screen/StonecutterScreenHandler;availableRecipes:Ljava/util/List;
intermediary field_17633
Lnet/minecraft/class_3971;field_17633:Ljava/util/List;
official w
Lcru;w:Ljava/util/List;
-
inputStack
- Mappings:
Namespace Name Mixin selector named inputStack
Lnet/minecraft/screen/StonecutterScreenHandler;inputStack:Lnet/minecraft/item/ItemStack;
intermediary field_17634
Lnet/minecraft/class_3971;field_17634:Lnet/minecraft/class_1799;
official x
Lcru;x:Lcuo;
-
lastTakeTime
long lastTakeTime- Mappings:
Namespace Name Mixin selector named lastTakeTime
Lnet/minecraft/screen/StonecutterScreenHandler;lastTakeTime:J
intermediary field_17635
Lnet/minecraft/class_3971;field_17635:J
official y
Lcru;y:J
-
inputSlot
- Mappings:
Namespace Name Mixin selector named inputSlot
Lnet/minecraft/screen/StonecutterScreenHandler;inputSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17627
Lnet/minecraft/class_3971;field_17627:Lnet/minecraft/class_1735;
official m
Lcru;m:Lcro;
-
outputSlot
- Mappings:
Namespace Name Mixin selector named outputSlot
Lnet/minecraft/screen/StonecutterScreenHandler;outputSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17628
Lnet/minecraft/class_3971;field_17628:Lnet/minecraft/class_1735;
official n
Lcru;n:Lcro;
-
contentsChangedListener
Runnable contentsChangedListener- Mappings:
Namespace Name Mixin selector named contentsChangedListener
Lnet/minecraft/screen/StonecutterScreenHandler;contentsChangedListener:Ljava/lang/Runnable;
intermediary field_17636
Lnet/minecraft/class_3971;field_17636:Ljava/lang/Runnable;
official z
Lcru;z:Ljava/lang/Runnable;
-
input
- Mappings:
Namespace Name Mixin selector named input
Lnet/minecraft/screen/StonecutterScreenHandler;input:Lnet/minecraft/inventory/Inventory;
intermediary field_17629
Lnet/minecraft/class_3971;field_17629:Lnet/minecraft/class_1263;
official o
Lcru;o:Lbqj;
-
output
- Mappings:
Namespace Name Mixin selector named output
Lnet/minecraft/screen/StonecutterScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;
intermediary field_19173
Lnet/minecraft/class_3971;field_19173:Lnet/minecraft/class_1731;
official A
Lcru;A:Lcrj;
-
-
Constructor Details
-
StonecutterScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/screen/StonecutterScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
intermediary <init>
Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;)V
official <init>
Lcru;<init>(ILcmu;)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;)V
intermediary <init>
Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
official <init>
Lcru;<init>(ILcmu;Lcqe;)V
-
-
Method Details
-
getSelectedRecipe
public int getSelectedRecipe()- Mappings:
Namespace Name Mixin selector named getSelectedRecipe
Lnet/minecraft/screen/StonecutterScreenHandler;getSelectedRecipe()I
intermediary method_17862
Lnet/minecraft/class_3971;method_17862()I
official l
Lcru;l()I
-
getAvailableRecipes
- Mappings:
Namespace Name Mixin selector named getAvailableRecipes
Lnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipes()Ljava/util/List;
intermediary method_17863
Lnet/minecraft/class_3971;method_17863()Ljava/util/List;
official m
Lcru;m()Ljava/util/List;
-
getAvailableRecipeCount
public int getAvailableRecipeCount()- Mappings:
Namespace Name Mixin selector named getAvailableRecipeCount
Lnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipeCount()I
intermediary method_17864
Lnet/minecraft/class_3971;method_17864()I
official n
Lcru;n()I
-
canCraft
public boolean canCraft()- Mappings:
Namespace Name Mixin selector named canCraft
Lnet/minecraft/screen/StonecutterScreenHandler;canCraft()Z
intermediary method_17865
Lnet/minecraft/class_3971;method_17865()Z
official o
Lcru;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:
canUse
in classScreenHandler
- Returns:
- whether the screen handler can be used
- Mappings:
Namespace Name Mixin selector named canUse
Lnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_7597
Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Z
official b
Lcps;b(Lcmv;)Z
-
onButtonClick
Called whenplayer
clicks 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:
onButtonClick
in 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 onButtonClick
Lnet/minecraft/screen/ScreenHandler;onButtonClick(Lnet/minecraft/entity/player/PlayerEntity;I)Z
intermediary method_7604
Lnet/minecraft/class_1703;method_7604(Lnet/minecraft/class_1657;I)Z
official a
Lcps;a(Lcmv;I)Z
-
isInBounds
private boolean isInBounds(int id) - Mappings:
Namespace Name Mixin selector named isInBounds
Lnet/minecraft/screen/StonecutterScreenHandler;isInBounds(I)Z
intermediary method_30160
Lnet/minecraft/class_3971;method_30160(I)Z
official e
Lcru;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
Inventory
whosemarkDirty
method 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:
onContentChanged
in classScreenHandler
- Mappings:
Namespace Name Mixin selector named onContentChanged
Lnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
intermediary method_7609
Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)V
official a
Lcps;a(Lbqj;)V
-
createRecipeInput
- Mappings:
Namespace Name Mixin selector named createRecipeInput
Lnet/minecraft/screen/StonecutterScreenHandler;createRecipeInput(Lnet/minecraft/inventory/Inventory;)Lnet/minecraft/recipe/input/SingleStackRecipeInput;
intermediary method_59966
Lnet/minecraft/class_3971;method_59966(Lnet/minecraft/class_1263;)Lnet/minecraft/class_9696;
official c
Lcru;c(Lbqj;)Lczn;
-
updateInput
- Mappings:
Namespace Name Mixin selector named updateInput
Lnet/minecraft/screen/StonecutterScreenHandler;updateInput(Lnet/minecraft/inventory/Inventory;Lnet/minecraft/item/ItemStack;)V
intermediary method_17855
Lnet/minecraft/class_3971;method_17855(Lnet/minecraft/class_1263;Lnet/minecraft/class_1799;)V
official a
Lcru;a(Lbqj;Lcuo;)V
-
populateResult
void populateResult()- Mappings:
Namespace Name Mixin selector named populateResult
Lnet/minecraft/screen/StonecutterScreenHandler;populateResult()V
intermediary method_17866
Lnet/minecraft/class_3971;method_17866()V
official p
Lcru;p()V
-
getType
Returns the screen handler type.A screen handler must have associated screen handler type to open it.
- Overrides:
getType
in classScreenHandler
- Returns:
- the screen handler type
- Throws:
UnsupportedOperationException
- if the type is not passed in the constructor- Mappings:
Namespace Name Mixin selector named getType
Lnet/minecraft/screen/ScreenHandler;getType()Lnet/minecraft/screen/ScreenHandlerType;
intermediary method_17358
Lnet/minecraft/class_1703;method_17358()Lnet/minecraft/class_3917;
official a
Lcps;a()Lcra;
-
setContentsChangedListener
- Mappings:
Namespace Name Mixin selector named setContentsChangedListener
Lnet/minecraft/screen/StonecutterScreenHandler;setContentsChangedListener(Ljava/lang/Runnable;)V
intermediary method_17859
Lnet/minecraft/class_3971;method_17859(Ljava/lang/Runnable;)V
official a
Lcru;a(Ljava/lang/Runnable;)V
-
canInsertIntoSlot
Returns whetherstack
can be inserted toslot
.Subclasses should override this to return
false
if the slot is used for output.- Overrides:
canInsertIntoSlot
in classScreenHandler
- Returns:
- whether
stack
can be inserted toslot
- Mappings:
Namespace Name Mixin selector named canInsertIntoSlot
Lnet/minecraft/screen/ScreenHandler;canInsertIntoSlot(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;)Z
intermediary method_7613
Lnet/minecraft/class_1703;method_7613(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;)Z
official a
Lcps;a(Lcuo;Lcro;)Z
-
quickMove
Quick-moves the stack atslot
to 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:
quickMove
in classScreenHandler
- Parameters:
slot
- the index of the slot to quick-move from- Returns:
ItemStack.EMPTY
when no stack can be transferred, otherwise the original stack- See Also:
- Mappings:
Namespace Name Mixin selector named quickMove
Lnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
intermediary method_7601
Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;
official b
Lcps;b(Lcmv;I)Lcuo;
-
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:
onClosed
in classScreenHandler
- Mappings:
Namespace Name Mixin selector named onClosed
Lnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V
intermediary method_7595
Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)V
official a
Lcps;a(Lcmv;)V
-