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 PlatformItemStack 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 PlatformItemStack 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 PlatformItemStackReturns the value of theitemStackrecord component.@NotNull TransformedItemStackmodify(@NotNull Function<PlatformItemStack, PlatformItemStack> mapper) Modify itemstatic @NotNull TransformedItemStackof(@NotNull PlatformItemStack itemStack) Creates transformed itemstatic @NotNull TransformedItemStackof(@NotNull org.joml.Vector3f position, @NotNull org.joml.Vector3f offset, @NotNull org.joml.Vector3f scale, @NotNull PlatformItemStack itemStack) Creates transformed item@NotNull org.joml.Vector3foffset()Returns the value of theoffsetrecord component.@NotNull TransformedItemStackoffset(@NotNull org.joml.Vector3f offset) Sets offset@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 PlatformItemStack 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 PlatformItemStack 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 PlatformItemStack itemStack) Creates transformed item- Parameters:
position- positionoffset- offsetscale- scaleitemStack- item- Returns:
- transformed item
-
asAir
Gets transformed item as air- Returns:
- air item
-
offset
Sets offset- Parameters:
offset- offset- Returns:
- new item
-
modify
@NotNull public @NotNull TransformedItemStack modify(@NotNull @NotNull Function<PlatformItemStack, PlatformItemStack> mapper) Modify item- Parameters:
mapper- mapper- Returns:
- modified item
-
isAir
public boolean isAir()Checks this item is air- Returns:
- is air
-
copy
-
toString
-
hashCode
-
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
-
offset
-
scale
-
itemStack
-