Package at.petrak.hexcasting.api.pigment
Record Class FrozenPigment
java.lang.Object
java.lang.Record
at.petrak.hexcasting.api.pigment.FrozenPigment
A snapshot of a pigment item and its owner.
Due to capabilities being really slow to query many times a tick on Forge, this returns a colorizer supplier. Get it once, and then query it a lot.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Supplier<FrozenPigment>static final Supplier<FrozenPigment>static final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionFrozenPigment(net.minecraft.world.item.ItemStack item, UUID owner) Creates an instance of aFrozenPigmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static FrozenPigmentfromNBT(net.minecraft.nbt.CompoundTag tag) final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackitem()Returns the value of theitemrecord component.owner()Returns the value of theownerrecord component.net.minecraft.nbt.CompoundTagfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
TAG_STACK
- See Also:
-
TAG_OWNER
- See Also:
-
DEFAULT
-
ANCIENT
-
-
Constructor Details
-
FrozenPigment
Creates an instance of aFrozenPigmentrecord class.- Parameters:
item- the value for theitemrecord componentowner- the value for theownerrecord component
-
-
Method Details
-
serializeToNBT
public net.minecraft.nbt.CompoundTag serializeToNBT() -
fromNBT
-
getColorProvider
-
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). -
item
public net.minecraft.world.item.ItemStack item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-