Class LecternScreenHandler

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

public class LecternScreenHandler extends ScreenHandler
Mappings:
Namespace Name
named net/minecraft/screen/LecternScreenHandler
intermediary net/minecraft/class_3916
official cqz
  • Field Details

    • field_30824

      private static final int field_30824
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30824 Lnet/minecraft/screen/LecternScreenHandler;field_30824:I
      intermediary field_30824 Lnet/minecraft/class_3916;field_30824:I
      official o Lcqz;o:I
    • field_30825

      private static final int field_30825
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30825 Lnet/minecraft/screen/LecternScreenHandler;field_30825:I
      intermediary field_30825 Lnet/minecraft/class_3916;field_30825:I
      official p Lcqz;p:I
    • PREVIOUS_PAGE_BUTTON_ID

      public static final int PREVIOUS_PAGE_BUTTON_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named PREVIOUS_PAGE_BUTTON_ID Lnet/minecraft/screen/LecternScreenHandler;PREVIOUS_PAGE_BUTTON_ID:I
      intermediary field_30820 Lnet/minecraft/class_3916;field_30820:I
      official k Lcqz;k:I
    • NEXT_PAGE_BUTTON_ID

      public static final int NEXT_PAGE_BUTTON_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named NEXT_PAGE_BUTTON_ID Lnet/minecraft/screen/LecternScreenHandler;NEXT_PAGE_BUTTON_ID:I
      intermediary field_30821 Lnet/minecraft/class_3916;field_30821:I
      official l Lcqz;l:I
    • TAKE_BOOK_BUTTON_ID

      public static final int TAKE_BOOK_BUTTON_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named TAKE_BOOK_BUTTON_ID Lnet/minecraft/screen/LecternScreenHandler;TAKE_BOOK_BUTTON_ID:I
      intermediary field_30822 Lnet/minecraft/class_3916;field_30822:I
      official m Lcqz;m:I
    • BASE_JUMP_TO_PAGE_BUTTON_ID

      public static final int BASE_JUMP_TO_PAGE_BUTTON_ID
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named BASE_JUMP_TO_PAGE_BUTTON_ID Lnet/minecraft/screen/LecternScreenHandler;BASE_JUMP_TO_PAGE_BUTTON_ID:I
      intermediary field_30823 Lnet/minecraft/class_3916;field_30823:I
      official n Lcqz;n:I
    • inventory

      private final Inventory inventory
      Mappings:
      Namespace Name Mixin selector
      named inventory Lnet/minecraft/screen/LecternScreenHandler;inventory:Lnet/minecraft/inventory/Inventory;
      intermediary field_17313 Lnet/minecraft/class_3916;field_17313:Lnet/minecraft/class_1263;
      official q Lcqz;q:Lbqo;
    • propertyDelegate

      private final PropertyDelegate propertyDelegate
      Mappings:
      Namespace Name Mixin selector
      named propertyDelegate Lnet/minecraft/screen/LecternScreenHandler;propertyDelegate:Lnet/minecraft/screen/PropertyDelegate;
      intermediary field_17314 Lnet/minecraft/class_3916;field_17314:Lnet/minecraft/class_3913;
      official r Lcqz;r:Lcqf;
  • Constructor Details

    • LecternScreenHandler

      public LecternScreenHandler(int syncId)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/screen/LecternScreenHandler;<init>(I)V
      intermediary <init> Lnet/minecraft/class_3916;<init>(I)V
      official <init> Lcqz;<init>(I)V
    • LecternScreenHandler

      public LecternScreenHandler(int syncId, Inventory inventory, PropertyDelegate propertyDelegate)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/screen/LecternScreenHandler;<init>(ILnet/minecraft/inventory/Inventory;Lnet/minecraft/screen/PropertyDelegate;)V
      intermediary <init> Lnet/minecraft/class_3916;<init>(ILnet/minecraft/class_1263;Lnet/minecraft/class_3913;)V
      official <init> Lcqz;<init>(ILbqo;Lcqf;)V
  • Method Details

    • 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
      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 b Lcpv;b(Lcmy;I)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
      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 a Lcpv;a(Lcmy;I)Lcuq;
    • setProperty

      public void setProperty(int id, int value)
      Sets the property with ID id to value.

      Subclasses can call ScreenHandler.sendContentUpdates() to manually sync the change to the client.

      Overrides:
      setProperty in class ScreenHandler
      Mappings:
      Namespace Name Mixin selector
      named setProperty Lnet/minecraft/screen/ScreenHandler;setProperty(II)V
      intermediary method_7606 Lnet/minecraft/class_1703;method_7606(II)V
      official a Lcpv;a(II)V
    • 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
      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 a Lcpv;a(Lcmy;)Z
    • getBookItem

      public ItemStack getBookItem()
      Mappings:
      Namespace Name Mixin selector
      named getBookItem Lnet/minecraft/screen/LecternScreenHandler;getBookItem()Lnet/minecraft/item/ItemStack;
      intermediary method_17418 Lnet/minecraft/class_3916;method_17418()Lnet/minecraft/class_1799;
      official l Lcqz;l()Lcuq;
    • getPage

      public int getPage()
      Mappings:
      Namespace Name Mixin selector
      named getPage Lnet/minecraft/screen/LecternScreenHandler;getPage()I
      intermediary method_17419 Lnet/minecraft/class_3916;method_17419()I
      official m Lcqz;m()I