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
ConstructorDescriptionEntity
(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 aEntity
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull ChunkSnapshot
chunk()
int
chunkX()
Returns the value of thechunkX
record component.int
chunkZ()
Returns the value of thechunkZ
record component.final boolean
Indicates whether some other object is "equal to" this one.<T> @UnknownNullability T
Reads the specified tag.final int
hashCode()
Returns a hash code value for this object.int
id()
Returns the value of theid
record component.@NotNull InstanceSnapshot
instance()
Returns the value of theinstanceRef
record component.@NotNull Collection
<@NotNull EntitySnapshot> int[]
Returns the value of thepassengersId
record component.position()
Returns the value of theposition
record component.Returns the value of thetagReadable
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.uuid()
Returns the value of theuuid
record component.@Nullable EntitySnapshot
vehicle()
int
Returns the value of thevehicleId
record component.velocity()
Returns the value of thevelocity
record component.@NotNull Collection
<@NotNull PlayerSnapshot> viewers()
int[]
Returns the value of theviewersId
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aEntity
record class.- Parameters:
type
- the value for thetype
record componentuuid
- the value for theuuid
record componentid
- the value for theid
record componentposition
- the value for theposition
record componentvelocity
- the value for thevelocity
record componentinstanceRef
- the value for theinstanceRef
record componentchunkX
- the value for thechunkX
record componentchunkZ
- the value for thechunkZ
record componentviewersId
- the value for theviewersId
record componentpassengersId
- the value for thepassengersId
record componentvehicleId
- the value for thevehicleId
record componenttagReadable
- the value for thetagReadable
record component
-
-
Method Details
-
getTag
Description copied from interface:TagReadable
Reads the specified tag.- Specified by:
getTag
in interfaceTagReadable
- Type Parameters:
T
- the tag type- Parameters:
tag
- the tag to read- Returns:
- the read tag, null if not present
-
instance
- Specified by:
instance
in interfaceEntitySnapshot
-
chunk
- Specified by:
chunk
in interfaceEntitySnapshot
-
viewers
- Specified by:
viewers
in interfaceEntitySnapshot
-
passengers
- Specified by:
passengers
in interfaceEntitySnapshot
-
vehicle
- Specified by:
vehicle
in 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 thetype
record component.- Specified by:
type
in interfaceEntitySnapshot
- Returns:
- the value of the
type
record component
-
uuid
Returns the value of theuuid
record component.- Specified by:
uuid
in interfaceEntitySnapshot
- Returns:
- the value of the
uuid
record component
-
id
public int id()Returns the value of theid
record component.- Specified by:
id
in interfaceEntitySnapshot
- Returns:
- the value of the
id
record component
-
position
Returns the value of theposition
record component.- Specified by:
position
in interfaceEntitySnapshot
- Returns:
- the value of the
position
record component
-
velocity
Returns the value of thevelocity
record component.- Specified by:
velocity
in interfaceEntitySnapshot
- Returns:
- the value of the
velocity
record component
-
instanceRef
Returns the value of theinstanceRef
record component.- Returns:
- the value of the
instanceRef
record component
-
chunkX
public int chunkX()Returns the value of thechunkX
record component.- Returns:
- the value of the
chunkX
record component
-
chunkZ
public int chunkZ()Returns the value of thechunkZ
record component.- Returns:
- the value of the
chunkZ
record component
-
viewersId
public int[] viewersId()Returns the value of theviewersId
record component.- Returns:
- the value of the
viewersId
record component
-
passengersId
public int[] passengersId()Returns the value of thepassengersId
record component.- Returns:
- the value of the
passengersId
record component
-
vehicleId
public int vehicleId()Returns the value of thevehicleId
record component.- Returns:
- the value of the
vehicleId
record component
-
tagReadable
Returns the value of thetagReadable
record component.- Returns:
- the value of the
tagReadable
record component
-