Package net.minestom.server.snapshot
Record Class SnapshotImpl.Entity
java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Entity
- All Implemented Interfaces:
EntitySnapshot,Snapshot,TagReadable
- Enclosing class:
SnapshotImpl
public static record SnapshotImpl.Entity(EntityType type, UUID uuid, int id, Pos position, Vec velocity, AtomicReference<InstanceSnapshot> instanceRef, int chunkX, int chunkZ, int[] viewersId, int[] passengersId, int vehicleId, TagReadable tagReadable)
extends Record
implements EntitySnapshot
-
Constructor Summary
ConstructorsConstructorDescriptionEntity(EntityType type, UUID uuid, int id, Pos position, Vec velocity, AtomicReference<InstanceSnapshot> instanceRef, int chunkX, int chunkZ, int[] viewersId, int[] passengersId, int vehicleId, TagReadable tagReadable) Creates an instance of aEntityrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull ChunkSnapshotchunk()intchunkX()Returns the value of thechunkXrecord component.intchunkZ()Returns the value of thechunkZrecord component.final booleanIndicates whether some other object is "equal to" this one.<T> @UnknownNullability TReads the specified tag.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.@NotNull InstanceSnapshotinstance()Returns the value of theinstanceRefrecord component.@NotNull Collection<@NotNull EntitySnapshot> int[]Returns the value of thepassengersIdrecord component.position()Returns the value of thepositionrecord component.Returns the value of thetagReadablerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.uuid()Returns the value of theuuidrecord component.@Nullable EntitySnapshotvehicle()intReturns the value of thevehicleIdrecord component.velocity()Returns the value of thevelocityrecord component.@NotNull Collection<@NotNull PlayerSnapshot> viewers()int[]Returns the value of theviewersIdrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.tag.TagReadable
hasTag
-
Constructor Details
-
Entity
public Entity(EntityType type, UUID uuid, int id, Pos position, Vec velocity, AtomicReference<InstanceSnapshot> instanceRef, int chunkX, int chunkZ, int[] viewersId, int[] passengersId, int vehicleId, TagReadable tagReadable) Creates an instance of aEntityrecord class.- Parameters:
type- the value for thetyperecord componentuuid- the value for theuuidrecord componentid- the value for theidrecord componentposition- the value for thepositionrecord componentvelocity- the value for thevelocityrecord componentinstanceRef- the value for theinstanceRefrecord componentchunkX- the value for thechunkXrecord componentchunkZ- the value for thechunkZrecord componentviewersId- the value for theviewersIdrecord componentpassengersId- the value for thepassengersIdrecord componentvehicleId- the value for thevehicleIdrecord componenttagReadable- the value for thetagReadablerecord component
-
-
Method Details
-
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin interfaceTagReadable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to read- Returns:
- the read tag, null if not present
-
instance
- Specified by:
instancein interfaceEntitySnapshot
-
chunk
- Specified by:
chunkin interfaceEntitySnapshot
-
viewers
- Specified by:
viewersin interfaceEntitySnapshot
-
passengers
- Specified by:
passengersin interfaceEntitySnapshot
-
vehicle
- Specified by:
vehiclein interfaceEntitySnapshot
-
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 '=='. -
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceEntitySnapshot- Returns:
- the value of the
typerecord component
-
uuid
Returns the value of theuuidrecord component.- Specified by:
uuidin interfaceEntitySnapshot- Returns:
- the value of the
uuidrecord component
-
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceEntitySnapshot- Returns:
- the value of the
idrecord component
-
position
Returns the value of thepositionrecord component.- Specified by:
positionin interfaceEntitySnapshot- Returns:
- the value of the
positionrecord component
-
velocity
Returns the value of thevelocityrecord component.- Specified by:
velocityin interfaceEntitySnapshot- Returns:
- the value of the
velocityrecord component
-
instanceRef
Returns the value of theinstanceRefrecord component.- Returns:
- the value of the
instanceRefrecord component
-
chunkX
public int chunkX()Returns the value of thechunkXrecord component.- Returns:
- the value of the
chunkXrecord component
-
chunkZ
public int chunkZ()Returns the value of thechunkZrecord component.- Returns:
- the value of the
chunkZrecord component
-
viewersId
public int[] viewersId()Returns the value of theviewersIdrecord component.- Returns:
- the value of the
viewersIdrecord component
-
passengersId
public int[] passengersId()Returns the value of thepassengersIdrecord component.- Returns:
- the value of the
passengersIdrecord component
-
vehicleId
public int vehicleId()Returns the value of thevehicleIdrecord component.- Returns:
- the value of the
vehicleIdrecord component
-
tagReadable
Returns the value of thetagReadablerecord component.- Returns:
- the value of the
tagReadablerecord component
-