Class LoomScreenHandler

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

public class LoomScreenHandler extends ScreenHandler
Mappings:
Namespace Name
official ccg
intermediary net/minecraft/class_1726
named net/minecraft/screen/LoomScreenHandler
  • Field Details

    • field_39120

      private static final int field_39120
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official k Lccg;k:I
      intermediary field_39120 Lnet/minecraft/class_1726;field_39120:I
      named field_39120 Lnet/minecraft/screen/LoomScreenHandler;field_39120:I
    • field_30826

      private static final int field_30826
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official l Lccg;l:I
      intermediary field_30826 Lnet/minecraft/class_1726;field_30826:I
      named field_30826 Lnet/minecraft/screen/LoomScreenHandler;field_30826:I
    • field_30827

      private static final int field_30827
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official m Lccg;m:I
      intermediary field_30827 Lnet/minecraft/class_1726;field_30827:I
      named field_30827 Lnet/minecraft/screen/LoomScreenHandler;field_30827:I
    • field_30828

      private static final int field_30828
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official n Lccg;n:I
      intermediary field_30828 Lnet/minecraft/class_1726;field_30828:I
      named field_30828 Lnet/minecraft/screen/LoomScreenHandler;field_30828:I
    • field_30829

      private static final int field_30829
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official o Lccg;o:I
      intermediary field_30829 Lnet/minecraft/class_1726;field_30829:I
      named field_30829 Lnet/minecraft/screen/LoomScreenHandler;field_30829:I
    • context

      private final ScreenHandlerContext context
      Mappings:
      Namespace Name Mixin selector
      official p Lccg;p:Lcbo;
      intermediary field_17316 Lnet/minecraft/class_1726;field_17316:Lnet/minecraft/class_3914;
      named context Lnet/minecraft/screen/LoomScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
    • selectedPattern

      final Property selectedPattern
      Mappings:
      Namespace Name Mixin selector
      official q Lccg;q:Lcbt;
      intermediary field_17317 Lnet/minecraft/class_1726;field_17317:Lnet/minecraft/class_3915;
      named selectedPattern Lnet/minecraft/screen/LoomScreenHandler;selectedPattern:Lnet/minecraft/screen/Property;
    • bannerPatterns

      private List<RegistryEntry<BannerPattern>> bannerPatterns
      Mappings:
      Namespace Name Mixin selector
      official r Lccg;r:Ljava/util/List;
      intermediary field_39121 Lnet/minecraft/class_1726;field_39121:Ljava/util/List;
      named bannerPatterns Lnet/minecraft/screen/LoomScreenHandler;bannerPatterns:Ljava/util/List;
    • inventoryChangeListener

      Runnable inventoryChangeListener
      Mappings:
      Namespace Name Mixin selector
      official s Lccg;s:Ljava/lang/Runnable;
      intermediary field_17318 Lnet/minecraft/class_1726;field_17318:Ljava/lang/Runnable;
      named inventoryChangeListener Lnet/minecraft/screen/LoomScreenHandler;inventoryChangeListener:Ljava/lang/Runnable;
    • bannerSlot

      final Slot bannerSlot
      Mappings:
      Namespace Name Mixin selector
      official t Lccg;t:Lccv;
      intermediary field_17319 Lnet/minecraft/class_1726;field_17319:Lnet/minecraft/class_1735;
      named bannerSlot Lnet/minecraft/screen/LoomScreenHandler;bannerSlot:Lnet/minecraft/screen/slot/Slot;
    • dyeSlot

      final Slot dyeSlot
      Mappings:
      Namespace Name Mixin selector
      official u Lccg;u:Lccv;
      intermediary field_17320 Lnet/minecraft/class_1726;field_17320:Lnet/minecraft/class_1735;
      named dyeSlot Lnet/minecraft/screen/LoomScreenHandler;dyeSlot:Lnet/minecraft/screen/slot/Slot;
    • patternSlot

      private final Slot patternSlot
      Mappings:
      Namespace Name Mixin selector
      official v Lccg;v:Lccv;
      intermediary field_17321 Lnet/minecraft/class_1726;field_17321:Lnet/minecraft/class_1735;
      named patternSlot Lnet/minecraft/screen/LoomScreenHandler;patternSlot:Lnet/minecraft/screen/slot/Slot;
    • outputSlot

      private final Slot outputSlot
      Mappings:
      Namespace Name Mixin selector
      official w Lccg;w:Lccv;
      intermediary field_17322 Lnet/minecraft/class_1726;field_17322:Lnet/minecraft/class_1735;
      named outputSlot Lnet/minecraft/screen/LoomScreenHandler;outputSlot:Lnet/minecraft/screen/slot/Slot;
    • lastTakeResultTime

      long lastTakeResultTime
      Mappings:
      Namespace Name Mixin selector
      official x Lccg;x:J
      intermediary field_20383 Lnet/minecraft/class_1726;field_20383:J
      named lastTakeResultTime Lnet/minecraft/screen/LoomScreenHandler;lastTakeResultTime:J
    • input

      private final Inventory input
      Mappings:
      Namespace Name Mixin selector
      official y Lccg;y:Lbdp;
      intermediary field_7850 Lnet/minecraft/class_1726;field_7850:Lnet/minecraft/class_1263;
      named input Lnet/minecraft/screen/LoomScreenHandler;input:Lnet/minecraft/inventory/Inventory;
    • output

      private final Inventory output
      Mappings:
      Namespace Name Mixin selector
      official z Lccg;z:Lbdp;
      intermediary field_17323 Lnet/minecraft/class_1726;field_17323:Lnet/minecraft/class_1263;
      named output Lnet/minecraft/screen/LoomScreenHandler;output:Lnet/minecraft/inventory/Inventory;
  • Constructor Details

    • LoomScreenHandler

      public LoomScreenHandler(int syncId, PlayerInventory playerInventory)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lccg;<init>(ILbyl;)V
      intermediary <init> Lnet/minecraft/class_1726;<init>(ILnet/minecraft/class_1661;)V
      named <init> Lnet/minecraft/screen/LoomScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
    • LoomScreenHandler

      public LoomScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lccg;<init>(ILbyl;Lcbo;)V
      intermediary <init> Lnet/minecraft/class_1726;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
      named <init> Lnet/minecraft/screen/LoomScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V
  • Method Details

    • 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 Lcbd;a(Lbym;)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 Lcbd;b(Lbym;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
    • getPatternsFor

      private List<RegistryEntry<BannerPattern>> getPatternsFor(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official c Lccg;c(Lcfx;)Ljava/util/List;
      intermediary method_43705 Lnet/minecraft/class_1726;method_43705(Lnet/minecraft/class_1799;)Ljava/util/List;
      named getPatternsFor Lnet/minecraft/screen/LoomScreenHandler;getPatternsFor(Lnet/minecraft/item/ItemStack;)Ljava/util/List;
    • isPatternIndexValid

      private boolean isPatternIndexValid(int index)
      Mappings:
      Namespace Name Mixin selector
      official e Lccg;e(I)Z
      intermediary method_45016 Lnet/minecraft/class_1726;method_45016(I)Z
      named isPatternIndexValid Lnet/minecraft/screen/LoomScreenHandler;isPatternIndexValid(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 Lcbd;a(Lbdp;)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
    • getBannerPatterns

      public List<RegistryEntry<BannerPattern>> getBannerPatterns()
      Mappings:
      Namespace Name Mixin selector
      official l Lccg;l()Ljava/util/List;
      intermediary method_43706 Lnet/minecraft/class_1726;method_43706()Ljava/util/List;
      named getBannerPatterns Lnet/minecraft/screen/LoomScreenHandler;getBannerPatterns()Ljava/util/List;
    • getSelectedPattern

      public int getSelectedPattern()
      Mappings:
      Namespace Name Mixin selector
      official m Lccg;m()I
      intermediary method_7647 Lnet/minecraft/class_1726;method_7647()I
      named getSelectedPattern Lnet/minecraft/screen/LoomScreenHandler;getSelectedPattern()I
    • setInventoryChangeListener

      public void setInventoryChangeListener(Runnable inventoryChangeListener)
      Mappings:
      Namespace Name Mixin selector
      official a Lccg;a(Ljava/lang/Runnable;)V
      intermediary method_17423 Lnet/minecraft/class_1726;method_17423(Ljava/lang/Runnable;)V
      named setInventoryChangeListener Lnet/minecraft/screen/LoomScreenHandler;setInventoryChangeListener(Ljava/lang/Runnable;)V
    • 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 Lcbd;a(Lbym;I)Lcfx;
      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 Lcbd;b(Lbym;)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
    • updateOutputSlot

      private void updateOutputSlot(RegistryEntry<BannerPattern> pattern)
      Mappings:
      Namespace Name Mixin selector
      official a Lccg;a(Lhe;)V
      intermediary method_7648 Lnet/minecraft/class_1726;method_7648(Lnet/minecraft/class_6880;)V
      named updateOutputSlot Lnet/minecraft/screen/LoomScreenHandler;updateOutputSlot(Lnet/minecraft/registry/entry/RegistryEntry;)V
    • getBannerSlot

      public Slot getBannerSlot()
      Mappings:
      Namespace Name Mixin selector
      official n Lccg;n()Lccv;
      intermediary method_17428 Lnet/minecraft/class_1726;method_17428()Lnet/minecraft/class_1735;
      named getBannerSlot Lnet/minecraft/screen/LoomScreenHandler;getBannerSlot()Lnet/minecraft/screen/slot/Slot;
    • getDyeSlot

      public Slot getDyeSlot()
      Mappings:
      Namespace Name Mixin selector
      official o Lccg;o()Lccv;
      intermediary method_17429 Lnet/minecraft/class_1726;method_17429()Lnet/minecraft/class_1735;
      named getDyeSlot Lnet/minecraft/screen/LoomScreenHandler;getDyeSlot()Lnet/minecraft/screen/slot/Slot;
    • getPatternSlot

      public Slot getPatternSlot()
      Mappings:
      Namespace Name Mixin selector
      official p Lccg;p()Lccv;
      intermediary method_17430 Lnet/minecraft/class_1726;method_17430()Lnet/minecraft/class_1735;
      named getPatternSlot Lnet/minecraft/screen/LoomScreenHandler;getPatternSlot()Lnet/minecraft/screen/slot/Slot;
    • getOutputSlot

      public Slot getOutputSlot()
      Mappings:
      Namespace Name Mixin selector
      official q Lccg;q()Lccv;
      intermediary method_17431 Lnet/minecraft/class_1726;method_17431()Lnet/minecraft/class_1735;
      named getOutputSlot Lnet/minecraft/screen/LoomScreenHandler;getOutputSlot()Lnet/minecraft/screen/slot/Slot;