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
ConstructorDescriptionBlockEntityImpl
(byte packedXZ, short y, int typeId, com.viaversion.nbt.tag.CompoundTag tag) Creates an instance of aBlockEntityImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.byte
packedXZ()
Returns the value of thepackedXZ
record component.com.viaversion.nbt.tag.CompoundTag
tag()
Returns the value of thetag
record component.final String
toString()
Returns a string representation of this record class.int
typeId()
Returns the value of thetypeId
record component.withTypeId
(int typeId) short
y()
Returns the value of they
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aBlockEntityImpl
record class.- Parameters:
packedXZ
- the value for thepackedXZ
record componenty
- the value for they
record componenttypeId
- the value for thetypeId
record componenttag
- the value for thetag
record component
-
-
Method Details
-
withTypeId
- Specified by:
withTypeId
in 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 thepackedXZ
record component.- Specified by:
packedXZ
in interfaceBlockEntity
- Returns:
- the value of the
packedXZ
record component
-
y
public short y()Returns the value of they
record component.- Specified by:
y
in interfaceBlockEntity
- Returns:
- the value of the
y
record component
-
typeId
public int typeId()Returns the value of thetypeId
record component.- Specified by:
typeId
in interfaceBlockEntity
- Returns:
- the value of the
typeId
record component
-
tag
public com.viaversion.nbt.tag.CompoundTag tag()Returns the value of thetag
record component.- Specified by:
tag
in interfaceBlockEntity
- Returns:
- the value of the
tag
record component
-