Package kr.toxicity.model.api.util
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:
-
Constructor Summary
ConstructorsConstructorDescriptionTransformedItemStack(@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 aTransformedItemStackrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull TransformedItemStackasAir()Gets transformed item as air@NotNull TransformedItemStackcopy()Copy this itemstatic @NotNull TransformedItemStackempty()Creates empty transformed itemfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisAir()Checks this item is air@NotNull org.bukkit.inventory.ItemStackReturns the value of theitemStackrecord component.@NotNull TransformedItemStackModify itemstatic @NotNull TransformedItemStackof(@NotNull org.bukkit.inventory.ItemStack itemStack) Creates transformed itemstatic @NotNull TransformedItemStackof(@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.Vector3foffset()Returns the value of theoffsetrecord component.@NotNull org.joml.Vector3fposition()Returns the value of thepositionrecord component.@NotNull org.joml.Vector3fscale()Returns the value of thescalerecord component.final StringtoString()Returns a string representation of this record class.
-
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 aTransformedItemStackrecord class.
-
-
Method Details
-
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- positionoffset- offsetscale- scaleitemStack- item- Returns:
- transformed item
-
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
Copy this item- Returns:
- copied item
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
position
@NotNull public @NotNull org.joml.Vector3f position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
offset
@NotNull public @NotNull org.joml.Vector3f offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
scale
@NotNull public @NotNull org.joml.Vector3f scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
itemStack
@NotNull public @NotNull org.bukkit.inventory.ItemStack itemStack()Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-