Class StonecutterScreenHandler

java.lang.Object
net.minecraft.screen.ScreenHandler
net.minecraft.screen.StonecutterScreenHandler

public class StonecutterScreenHandler extends ScreenHandler
Mappings:
Namespace Name
official cka
intermediary net/minecraft/class_3971
named net/minecraft/screen/StonecutterScreenHandler
  • Field Details

    • INPUT_ID

      public static final int INPUT_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official k Lcka;k:I
      intermediary field_30842 Lnet/minecraft/class_3971;field_30842:I
      named INPUT_ID Lnet/minecraft/screen/StonecutterScreenHandler;INPUT_ID:I
    • OUTPUT_ID

      public static final int OUTPUT_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official l Lcka;l:I
      intermediary field_30843 Lnet/minecraft/class_3971;field_30843:I
      named OUTPUT_ID Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_ID:I
    • INVENTORY_START

      private static final int INVENTORY_START
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official p Lcka;p:I
      intermediary field_30844 Lnet/minecraft/class_3971;field_30844:I
      named INVENTORY_START Lnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_START:I
    • INVENTORY_END

      private static final int INVENTORY_END
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official q Lcka;q:I
      intermediary field_30845 Lnet/minecraft/class_3971;field_30845:I
      named INVENTORY_END Lnet/minecraft/screen/StonecutterScreenHandler;INVENTORY_END:I
    • OUTPUT_START

      private static final int OUTPUT_START
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official r Lcka;r:I
      intermediary field_30846 Lnet/minecraft/class_3971;field_30846:I
      named OUTPUT_START Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_START:I
    • OUTPUT_END

      private static final int OUTPUT_END
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official s Lcka;s:I
      intermediary field_30847 Lnet/minecraft/class_3971;field_30847:I
      named OUTPUT_END Lnet/minecraft/screen/StonecutterScreenHandler;OUTPUT_END:I
    • context

      private final ScreenHandlerContext context
      Mappings:
      Namespace Name Mixin selector
      official t Lcka;t:Lcim;
      intermediary field_17630 Lnet/minecraft/class_3971;field_17630:Lnet/minecraft/class_3914;
      named context Lnet/minecraft/screen/StonecutterScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
    • selectedRecipe

      private final Property selectedRecipe
      Mappings:
      Namespace Name Mixin selector
      official u Lcka;u:Lcit;
      intermediary field_17631 Lnet/minecraft/class_3971;field_17631:Lnet/minecraft/class_3915;
      named selectedRecipe Lnet/minecraft/screen/StonecutterScreenHandler;selectedRecipe:Lnet/minecraft/screen/Property;
    • world

      private final World world
      Mappings:
      Namespace Name Mixin selector
      official v Lcka;v:Lctp;
      intermediary field_17632 Lnet/minecraft/class_3971;field_17632:Lnet/minecraft/class_1937;
      named world Lnet/minecraft/screen/StonecutterScreenHandler;world:Lnet/minecraft/world/World;
    • availableRecipes

      private List<RecipeEntry<StonecuttingRecipe>> availableRecipes
      Mappings:
      Namespace Name Mixin selector
      official w Lcka;w:Ljava/util/List;
      intermediary field_17633 Lnet/minecraft/class_3971;field_17633:Ljava/util/List;
      named availableRecipes Lnet/minecraft/screen/StonecutterScreenHandler;availableRecipes:Ljava/util/List;
    • inputStack

      private ItemStack inputStack
      Mappings:
      Namespace Name Mixin selector
      official x Lcka;x:Lcmy;
      intermediary field_17634 Lnet/minecraft/class_3971;field_17634:Lnet/minecraft/class_1799;
      named inputStack Lnet/minecraft/screen/StonecutterScreenHandler;inputStack:Lnet/minecraft/item/ItemStack;
    • lastTakeTime

      long lastTakeTime
      Mappings:
      Namespace Name Mixin selector
      official y Lcka;y:J
      intermediary field_17635 Lnet/minecraft/class_3971;field_17635:J
      named lastTakeTime Lnet/minecraft/screen/StonecutterScreenHandler;lastTakeTime:J
    • inputSlot

      final Slot inputSlot
      Mappings:
      Namespace Name Mixin selector
      official m Lcka;m:Lcjw;
      intermediary field_17627 Lnet/minecraft/class_3971;field_17627:Lnet/minecraft/class_1735;
      named inputSlot Lnet/minecraft/screen/StonecutterScreenHandler;inputSlot:Lnet/minecraft/screen/slot/Slot;
    • outputSlot

      final Slot outputSlot
      Mappings:
      Namespace Name Mixin selector
      official n Lcka;n:Lcjw;
      intermediary field_17628 Lnet/minecraft/class_3971;field_17628:Lnet/minecraft/class_1735;
      named outputSlot Lnet/minecraft/screen/StonecutterScreenHandler;outputSlot:Lnet/minecraft/screen/slot/Slot;
    • contentsChangedListener

      Runnable contentsChangedListener
      Mappings:
      Namespace Name Mixin selector
      official z Lcka;z:Ljava/lang/Runnable;
      intermediary field_17636 Lnet/minecraft/class_3971;field_17636:Ljava/lang/Runnable;
      named contentsChangedListener Lnet/minecraft/screen/StonecutterScreenHandler;contentsChangedListener:Ljava/lang/Runnable;
    • input

      public final Inventory input
      Mappings:
      Namespace Name Mixin selector
      official o Lcka;o:Lbju;
      intermediary field_17629 Lnet/minecraft/class_3971;field_17629:Lnet/minecraft/class_1263;
      named input Lnet/minecraft/screen/StonecutterScreenHandler;input:Lnet/minecraft/inventory/Inventory;
    • output

      Mappings:
      Namespace Name Mixin selector
      official A Lcka;A:Lcjr;
      intermediary field_19173 Lnet/minecraft/class_3971;field_19173:Lnet/minecraft/class_1731;
      named output Lnet/minecraft/screen/StonecutterScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;
  • Constructor Details

    • StonecutterScreenHandler

      public StonecutterScreenHandler(int syncId, PlayerInventory playerInventory)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcka;<init>(ILcfh;)V
      intermediary <init> Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;)V
      named <init> Lnet/minecraft/screen/StonecutterScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
    • StonecutterScreenHandler

      public StonecutterScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcka;<init>(ILcfh;Lcim;)V
      intermediary <init> Lnet/minecraft/class_3971;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
      named <init> Lnet/minecraft/screen/StonecutterScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V
  • Method Details

    • getSelectedRecipe

      public int getSelectedRecipe()
      Mappings:
      Namespace Name Mixin selector
      official l Lcka;l()I
      intermediary method_17862 Lnet/minecraft/class_3971;method_17862()I
      named getSelectedRecipe Lnet/minecraft/screen/StonecutterScreenHandler;getSelectedRecipe()I
    • getAvailableRecipes

      public List<RecipeEntry<StonecuttingRecipe>> getAvailableRecipes()
      Mappings:
      Namespace Name Mixin selector
      official m Lcka;m()Ljava/util/List;
      intermediary method_17863 Lnet/minecraft/class_3971;method_17863()Ljava/util/List;
      named getAvailableRecipes Lnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipes()Ljava/util/List;
    • getAvailableRecipeCount

      public int getAvailableRecipeCount()
      Mappings:
      Namespace Name Mixin selector
      official n Lcka;n()I
      intermediary method_17864 Lnet/minecraft/class_3971;method_17864()I
      named getAvailableRecipeCount Lnet/minecraft/screen/StonecutterScreenHandler;getAvailableRecipeCount()I
    • canCraft

      public boolean canCraft()
      Mappings:
      Namespace Name Mixin selector
      official o Lcka;o()Z
      intermediary method_17865 Lnet/minecraft/class_3971;method_17865()Z
      named canCraft Lnet/minecraft/screen/StonecutterScreenHandler;canCraft()Z
    • canUse

      public boolean canUse(PlayerEntity player)
      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 class ScreenHandler
      Returns:
      whether the screen handler can be used
      Mappings:
      Namespace Name Mixin selector
      official a Lcib;a(Lcfi;)Z
      intermediary method_7597 Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Z
      named canUse Lnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • onButtonClick

      public boolean onButtonClick(PlayerEntity player, int id)
      Called when player clicks a button with id.

      "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 class ScreenHandler
      Returns:
      whether the button click is handled successfully
      Mappings:
      Namespace Name Mixin selector
      official b Lcib;b(Lcfi;I)Z
      intermediary method_7604 Lnet/minecraft/class_1703;method_7604(Lnet/minecraft/class_1657;I)Z
      named onButtonClick Lnet/minecraft/screen/ScreenHandler;onButtonClick(Lnet/minecraft/entity/player/PlayerEntity;I)Z
    • isInBounds

      private boolean isInBounds(int id)
      Mappings:
      Namespace Name Mixin selector
      official e Lcka;e(I)Z
      intermediary method_30160 Lnet/minecraft/class_3971;method_30160(I)Z
      named isInBounds Lnet/minecraft/screen/StonecutterScreenHandler;isInBounds(I)Z
    • onContentChanged

      public void onContentChanged(Inventory inventory)
      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 whose markDirty 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 class ScreenHandler
      Mappings:
      Namespace Name Mixin selector
      official a Lcib;a(Lbju;)V
      intermediary method_7609 Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)V
      named onContentChanged Lnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
    • updateInput

      private void updateInput(Inventory input, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lcka;a(Lbju;Lcmy;)V
      intermediary method_17855 Lnet/minecraft/class_3971;method_17855(Lnet/minecraft/class_1263;Lnet/minecraft/class_1799;)V
      named updateInput Lnet/minecraft/screen/StonecutterScreenHandler;updateInput(Lnet/minecraft/inventory/Inventory;Lnet/minecraft/item/ItemStack;)V
    • populateResult

      void populateResult()
      Mappings:
      Namespace Name Mixin selector
      official p Lcka;p()V
      intermediary method_17866 Lnet/minecraft/class_3971;method_17866()V
      named populateResult Lnet/minecraft/screen/StonecutterScreenHandler;populateResult()V
    • getType

      public ScreenHandlerType<?> getType()
      Returns the screen handler type.

      A screen handler must have associated screen handler type to open it.

      Overrides:
      getType in class ScreenHandler
      Returns:
      the screen handler type
      Mappings:
      Namespace Name Mixin selector
      official a Lcib;a()Lcji;
      intermediary method_17358 Lnet/minecraft/class_1703;method_17358()Lnet/minecraft/class_3917;
      named getType Lnet/minecraft/screen/ScreenHandler;getType()Lnet/minecraft/screen/ScreenHandlerType;
    • setContentsChangedListener

      public void setContentsChangedListener(Runnable contentsChangedListener)
      Mappings:
      Namespace Name Mixin selector
      official a Lcka;a(Ljava/lang/Runnable;)V
      intermediary method_17859 Lnet/minecraft/class_3971;method_17859(Ljava/lang/Runnable;)V
      named setContentsChangedListener Lnet/minecraft/screen/StonecutterScreenHandler;setContentsChangedListener(Ljava/lang/Runnable;)V
    • canInsertIntoSlot

      public boolean canInsertIntoSlot(ItemStack stack, Slot slot)
      Returns whether stack can be inserted to slot.

      Subclasses should override this to return false if the slot is used for output.

      Overrides:
      canInsertIntoSlot in class ScreenHandler
      Returns:
      whether stack can be inserted to slot
      Mappings:
      Namespace Name Mixin selector
      official a Lcib;a(Lcmy;Lcjw;)Z
      intermediary method_7613 Lnet/minecraft/class_1703;method_7613(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;)Z
      named canInsertIntoSlot Lnet/minecraft/screen/ScreenHandler;canInsertIntoSlot(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;)Z
    • quickMove

      public ItemStack quickMove(PlayerEntity player, int slot)
      Quick-moves the stack at slot 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 class ScreenHandler
      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
      official a Lcib;a(Lcfi;I)Lcmy;
      intermediary method_7601 Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;
      named quickMove Lnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
    • onClosed

      public void onClosed(PlayerEntity player)
      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 class ScreenHandler
      Mappings:
      Namespace Name Mixin selector
      official b Lcib;b(Lcfi;)V
      intermediary method_7595 Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)V
      named onClosed Lnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V