Record Class SpiritBoxBlockEntity.DataAccess
java.lang.Object
java.lang.Record
net.darkhax.ghostgear.common.impl.spiritbox.SpiritBoxBlockEntity.DataAccess
- All Implemented Interfaces:
net.minecraft.world.inventory.ContainerData
- Enclosing class:
SpiritBoxBlockEntity
public static record SpiritBoxBlockEntity.DataAccess(SpiritBoxBlockEntity box)
extends Record
implements net.minecraft.world.inventory.ContainerData
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aDataAccessrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbox()Returns the value of theboxrecord component.final booleanIndicates whether some other object is "equal to" this one.intget(int index) intgetCount()final inthashCode()Returns a hash code value for this object.voidset(int index, int value) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DataAccess
Creates an instance of aDataAccessrecord class.- Parameters:
box- the value for theboxrecord component
-
-
Method Details
-
get
public int get(int index) - Specified by:
getin interfacenet.minecraft.world.inventory.ContainerData
-
set
public void set(int index, int value) - Specified by:
setin interfacenet.minecraft.world.inventory.ContainerData
-
getCount
public int getCount()- Specified by:
getCountin interfacenet.minecraft.world.inventory.ContainerData
-
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). -
box
Returns the value of theboxrecord component.- Returns:
- the value of the
boxrecord component
-