Class ForgingScreenHandler

java.lang.Object
net.minecraft.screen.ScreenHandler
net.minecraft.screen.ForgingScreenHandler
Direct Known Subclasses:
AnvilScreenHandler, SmithingScreenHandler

public abstract class ForgingScreenHandler extends ScreenHandler
Mappings:
Namespace Name
named net/minecraft/screen/ForgingScreenHandler
intermediary net/minecraft/class_4861
official cqx
  • Field Details Link icon

    • field_41901 Link icon

      private static final int field_41901
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_41901 Lnet/minecraft/screen/ForgingScreenHandler;field_41901:I
      intermediary field_41901 Lnet/minecraft/class_4861;field_41901:I
      official k Lcqx;k:I
    • field_41902 Link icon

      private static final int field_41902
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_41902 Lnet/minecraft/screen/ForgingScreenHandler;field_41902:I
      intermediary field_41902 Lnet/minecraft/class_4861;field_41902:I
      official l Lcqx;l:I
    • context Link icon

      protected final ScreenHandlerContext context
      Mappings:
      Namespace Name Mixin selector
      named context Lnet/minecraft/screen/ForgingScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
      intermediary field_22481 Lnet/minecraft/class_4861;field_22481:Lnet/minecraft/class_3914;
      official o Lcqx;o:Lcqg;
    • player Link icon

      protected final PlayerEntity player
      Mappings:
      Namespace Name Mixin selector
      named player Lnet/minecraft/screen/ForgingScreenHandler;player:Lnet/minecraft/entity/player/PlayerEntity;
      intermediary field_22482 Lnet/minecraft/class_4861;field_22482:Lnet/minecraft/class_1657;
      official p Lcqx;p:Lcmx;
    • input Link icon

      protected final Inventory input
      Mappings:
      Namespace Name Mixin selector
      named input Lnet/minecraft/screen/ForgingScreenHandler;input:Lnet/minecraft/inventory/Inventory;
      intermediary field_22480 Lnet/minecraft/class_4861;field_22480:Lnet/minecraft/class_1263;
      official q Lcqx;q:Lbqk;
    • inputSlotIndices Link icon

      private final List<Integer> inputSlotIndices
      Mappings:
      Namespace Name Mixin selector
      named inputSlotIndices Lnet/minecraft/screen/ForgingScreenHandler;inputSlotIndices:Ljava/util/List;
      intermediary field_41903 Lnet/minecraft/class_4861;field_41903:Ljava/util/List;
      official m Lcqx;m:Ljava/util/List;
    • output Link icon

      protected final CraftingResultInventory output
      Mappings:
      Namespace Name Mixin selector
      named output Lnet/minecraft/screen/ForgingScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;
      intermediary field_22479 Lnet/minecraft/class_4861;field_22479:Lnet/minecraft/class_1731;
      official r Lcqx;r:Lcrl;
    • resultSlotIndex Link icon

      private final int resultSlotIndex
      Mappings:
      Namespace Name Mixin selector
      named resultSlotIndex Lnet/minecraft/screen/ForgingScreenHandler;resultSlotIndex:I
      intermediary field_41904 Lnet/minecraft/class_4861;field_41904:I
      official n Lcqx;n:I
  • Constructor Details Link icon

    • ForgingScreenHandler Link icon

      public ForgingScreenHandler(@Nullable @Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/screen/ForgingScreenHandler;<init>(Lnet/minecraft/screen/ScreenHandlerType;ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V
      intermediary <init> Lnet/minecraft/class_4861;<init>(Lnet/minecraft/class_3917;ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
      official <init> Lcqx;<init>(Lcrc;ILcmw;Lcqg;)V
  • Method Details Link icon

    • canTakeOutput Link icon

      protected abstract boolean canTakeOutput(PlayerEntity player, boolean present)
      Mappings:
      Namespace Name Mixin selector
      named canTakeOutput Lnet/minecraft/screen/ForgingScreenHandler;canTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Z)Z
      intermediary method_24927 Lnet/minecraft/class_4861;method_24927(Lnet/minecraft/class_1657;Z)Z
      official a Lcqx;a(Lcmx;Z)Z
    • onTakeOutput Link icon

      protected abstract void onTakeOutput(PlayerEntity player, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named onTakeOutput Lnet/minecraft/screen/ForgingScreenHandler;onTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
      intermediary method_24923 Lnet/minecraft/class_4861;method_24923(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
      official a Lcqx;a(Lcmx;Lcuq;)V
    • canUse Link icon

      protected abstract boolean canUse(BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named canUse Lnet/minecraft/screen/ForgingScreenHandler;canUse(Lnet/minecraft/block/BlockState;)Z
      intermediary method_24925 Lnet/minecraft/class_4861;method_24925(Lnet/minecraft/class_2680;)Z
      official a Lcqx;a(Ldtc;)Z
    • addInputSlots Link icon

      private void addInputSlots(ForgingSlotsManager forgingSlotsManager)
      Mappings:
      Namespace Name Mixin selector
      named addInputSlots Lnet/minecraft/screen/ForgingScreenHandler;addInputSlots(Lnet/minecraft/screen/slot/ForgingSlotsManager;)V
      intermediary method_48354 Lnet/minecraft/class_4861;method_48354(Lnet/minecraft/class_8047;)V
      official a Lcqx;a(Lcqy;)V
    • addResultSlot Link icon

      private void addResultSlot(ForgingSlotsManager forgingSlotsManager)
      Mappings:
      Namespace Name Mixin selector
      named addResultSlot Lnet/minecraft/screen/ForgingScreenHandler;addResultSlot(Lnet/minecraft/screen/slot/ForgingSlotsManager;)V
      intermediary method_48355 Lnet/minecraft/class_4861;method_48355(Lnet/minecraft/class_8047;)V
      official b Lcqx;b(Lcqy;)V
    • addPlayerInventorySlots Link icon

      private void addPlayerInventorySlots(PlayerInventory playerInventory)
      Mappings:
      Namespace Name Mixin selector
      named addPlayerInventorySlots Lnet/minecraft/screen/ForgingScreenHandler;addPlayerInventorySlots(Lnet/minecraft/entity/player/PlayerInventory;)V
      intermediary method_48353 Lnet/minecraft/class_4861;method_48353(Lnet/minecraft/class_1661;)V
      official a Lcqx;a(Lcmw;)V
    • updateResult Link icon

      public abstract void updateResult()
      Mappings:
      Namespace Name Mixin selector
      named updateResult Lnet/minecraft/screen/ForgingScreenHandler;updateResult()V
      intermediary method_24928 Lnet/minecraft/class_4861;method_24928()V
      official m Lcqx;m()V
    • getForgingSlotsManager Link icon

      protected abstract ForgingSlotsManager getForgingSlotsManager()
      Mappings:
      Namespace Name Mixin selector
      named getForgingSlotsManager Lnet/minecraft/screen/ForgingScreenHandler;getForgingSlotsManager()Lnet/minecraft/screen/slot/ForgingSlotsManager;
      intermediary method_48352 Lnet/minecraft/class_4861;method_48352()Lnet/minecraft/class_8047;
      official l Lcqx;l()Lcqy;
    • createInputInventory Link icon

      private SimpleInventory createInputInventory(int size)
      Mappings:
      Namespace Name Mixin selector
      named createInputInventory Lnet/minecraft/screen/ForgingScreenHandler;createInputInventory(I)Lnet/minecraft/inventory/SimpleInventory;
      intermediary method_48358 Lnet/minecraft/class_4861;method_48358(I)Lnet/minecraft/class_1277;
      official e Lcqx;e(I)Lbra;
    • onContentChanged Link icon

      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
      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 Lcpu;a(Lbqk;)V
    • onClosed Link icon

      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
      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 Lcpu;a(Lcmx;)V
    • canUse Link icon

      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
      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 Lcpu;b(Lcmx;)Z
    • quickMove Link icon

      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
      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 Lcpu;b(Lcmx;I)Lcuq;
    • isValidIngredient Link icon

      protected boolean isValidIngredient(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named isValidIngredient Lnet/minecraft/screen/ForgingScreenHandler;isValidIngredient(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_48356 Lnet/minecraft/class_4861;method_48356(Lnet/minecraft/class_1799;)Z
      official c Lcqx;c(Lcuq;)Z
    • getSlotFor Link icon

      public int getSlotFor(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getSlotFor Lnet/minecraft/screen/ForgingScreenHandler;getSlotFor(Lnet/minecraft/item/ItemStack;)I
      intermediary method_48357 Lnet/minecraft/class_4861;method_48357(Lnet/minecraft/class_1799;)I
      official d Lcqx;d(Lcuq;)I
    • getResultSlotIndex Link icon

      public int getResultSlotIndex()
      Mappings:
      Namespace Name Mixin selector
      named getResultSlotIndex Lnet/minecraft/screen/ForgingScreenHandler;getResultSlotIndex()I
      intermediary method_48360 Lnet/minecraft/class_4861;method_48360()I
      official o Lcqx;o()I
    • getPlayerInventoryStartIndex Link icon

      private int getPlayerInventoryStartIndex()
      Mappings:
      Namespace Name Mixin selector
      named getPlayerInventoryStartIndex Lnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryStartIndex()I
      intermediary method_48359 Lnet/minecraft/class_4861;method_48359()I
      official n Lcqx;n()I
    • getPlayerInventoryEndIndex Link icon

      private int getPlayerInventoryEndIndex()
      Mappings:
      Namespace Name Mixin selector
      named getPlayerInventoryEndIndex Lnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryEndIndex()I
      intermediary method_48361 Lnet/minecraft/class_4861;method_48361()I
      official p Lcqx;p()I
    • getPlayerHotbarStartIndex Link icon

      private int getPlayerHotbarStartIndex()
      Mappings:
      Namespace Name Mixin selector
      named getPlayerHotbarStartIndex Lnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarStartIndex()I
      intermediary method_48362 Lnet/minecraft/class_4861;method_48362()I
      official q Lcqx;q()I
    • getPlayerHotbarEndIndex Link icon

      private int getPlayerHotbarEndIndex()
      Mappings:
      Namespace Name Mixin selector
      named getPlayerHotbarEndIndex Lnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarEndIndex()I
      intermediary method_48363 Lnet/minecraft/class_4861;method_48363()I
      official r Lcqx;r()I