Record Class ScribeAction.TakeBook

java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.menu.scribe.controller.ScribeAction.TakeBook
All Implemented Interfaces:
ScribeAction
Enclosing interface:
ScribeAction

public static record ScribeAction.TakeBook() extends Record implements ScribeAction
Action representing the player extracting the target book from the lectern directly through the UI.
  • Constructor Details

    • TakeBook

      public TakeBook()
      Creates an instance of a TakeBook record class.
  • Method Details

    • execute

      public boolean execute(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container container, ScribeGridData gridData, net.minecraft.world.inventory.ContainerLevelAccess access)
      Description copied from interface: ScribeAction
      Executes the action, modifying the container and the player's state.
      Specified by:
      execute in interface ScribeAction
      Parameters:
      player - The player executing the action.
      container - The active container holding the fuel and source.
      gridData - The synchronized data matrix.
      access - The container's level access to mutate blocks.
      Returns:
      true if the action was successfully performed, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.