Record Class BlockEntityImpl
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.blockentity.BlockEntityImpl
- All Implemented Interfaces:
BlockEntity
public record BlockEntityImpl(byte packedXZ, short y, int typeId, com.viaversion.nbt.tag.CompoundTag tag)
extends Record
implements BlockEntity
-
Constructor Summary
ConstructorsConstructorDescriptionBlockEntityImpl(byte packedXZ, short y, int typeId, com.viaversion.nbt.tag.CompoundTag tag) Creates an instance of aBlockEntityImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.bytepackedXZ()Returns the value of thepackedXZrecord component.com.viaversion.nbt.tag.CompoundTagtag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.inttypeId()Returns the value of thetypeIdrecord component.withTypeId(int typeId) shorty()Returns the value of theyrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity
sectionX, sectionZ
-
Constructor Details
-
BlockEntityImpl
public BlockEntityImpl(byte packedXZ, short y, int typeId, com.viaversion.nbt.tag.CompoundTag tag) Creates an instance of aBlockEntityImplrecord class.- Parameters:
packedXZ- the value for thepackedXZrecord componenty- the value for theyrecord componenttypeId- the value for thetypeIdrecord componenttag- the value for thetagrecord component
-
-
Method Details
-
withTypeId
- Specified by:
withTypeIdin interfaceBlockEntity
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
packedXZ
public byte packedXZ()Returns the value of thepackedXZrecord component.- Specified by:
packedXZin interfaceBlockEntity- Returns:
- the value of the
packedXZrecord component
-
y
public short y()Returns the value of theyrecord component.- Specified by:
yin interfaceBlockEntity- Returns:
- the value of the
yrecord component
-
typeId
public int typeId()Returns the value of thetypeIdrecord component.- Specified by:
typeIdin interfaceBlockEntity- Returns:
- the value of the
typeIdrecord component
-
tag
public com.viaversion.nbt.tag.CompoundTag tag()Returns the value of thetagrecord component.- Specified by:
tagin interfaceBlockEntity- Returns:
- the value of the
tagrecord component
-