Record Class TransformedItemStack

java.lang.Object
java.lang.Record
kr.toxicity.model.api.util.TransformedItemStack
Record Components:
position - global position (x, y, z)
offset - offset (x, y, z)
scale - scale (x, y, z)
itemStack - item

public record TransformedItemStack(@NotNull org.joml.Vector3f position, @NotNull org.joml.Vector3f offset, @NotNull org.joml.Vector3f scale, @NotNull org.bukkit.inventory.ItemStack itemStack) extends Record
ItemStack with offset and scale
See Also:
  • ItemStack
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransformedItemStack(@NotNull org.joml.Vector3f position, @NotNull org.joml.Vector3f offset, @NotNull org.joml.Vector3f scale, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Creates an instance of a TransformedItemStack record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets transformed item as air
    Copy this item
    static @NotNull TransformedItemStack
    Creates empty transformed item
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Checks this item is air
    @NotNull org.bukkit.inventory.ItemStack
    Returns the value of the itemStack record component.
    modify(@NotNull Function<org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack> mapper)
    Modify item
    static @NotNull TransformedItemStack
    of(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Creates transformed item
    static @NotNull TransformedItemStack
    of(@NotNull org.joml.Vector3f position, @NotNull org.joml.Vector3f offset, @NotNull org.joml.Vector3f scale, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Creates transformed item
    @NotNull org.joml.Vector3f
    Returns the value of the offset record component.
    @NotNull org.joml.Vector3f
    Returns the value of the position record component.
    @NotNull org.joml.Vector3f
    Returns the value of the scale record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TransformedItemStack

      public TransformedItemStack(@NotNull @NotNull org.joml.Vector3f position, @NotNull @NotNull org.joml.Vector3f offset, @NotNull @NotNull org.joml.Vector3f scale, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Creates an instance of a TransformedItemStack record class.
      Parameters:
      position - the value for the position record component
      offset - the value for the offset record component
      scale - the value for the scale record component
      itemStack - the value for the itemStack record component
  • Method Details

    • empty

      @NotNull public static @NotNull TransformedItemStack empty()
      Creates empty transformed item
      Returns:
      empty transformed item
    • of

      @NotNull public static @NotNull TransformedItemStack of(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Creates transformed item
      Parameters:
      itemStack - item
      Returns:
      transformed item
    • of

      @NotNull public static @NotNull TransformedItemStack of(@NotNull @NotNull org.joml.Vector3f position, @NotNull @NotNull org.joml.Vector3f offset, @NotNull @NotNull org.joml.Vector3f scale, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Creates transformed item
      Parameters:
      position - position
      offset - offset
      scale - scale
      itemStack - item
      Returns:
      transformed item
    • asAir

      @NotNull public @NotNull TransformedItemStack asAir()
      Gets transformed item as air
      Returns:
      air item
    • modify

      @NotNull public @NotNull TransformedItemStack modify(@NotNull @NotNull Function<org.bukkit.inventory.ItemStack,org.bukkit.inventory.ItemStack> mapper)
      Modify item
      Parameters:
      mapper - mapper
      Returns:
      modified item
    • isAir

      public boolean isAir()
      Checks this item is air
      Returns:
      is air
    • copy

      @NotNull public @NotNull TransformedItemStack copy()
      Copy this item
      Returns:
      copied item
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • position

      @NotNull public @NotNull org.joml.Vector3f position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • offset

      @NotNull public @NotNull org.joml.Vector3f offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • scale

      @NotNull public @NotNull org.joml.Vector3f scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • itemStack

      @NotNull public @NotNull org.bukkit.inventory.ItemStack itemStack()
      Returns the value of the itemStack record component.
      Returns:
      the value of the itemStack record component