public interface EntitySnapshot extends LocateableSnapshot<EntitySnapshot>
Entity
and all of it's related data in
the form of ImmutableDataManipulator
s and ImmutableValue
s.
While an Entity
is a live instance and therefor residing in a
World
, an EntitySnapshot
may be snapshotted of a
World
that is not currently loaded, or may not exist any longer.
All data associated with the EntitySnapshot
should be separated
from the Game
instance such that external processing, building,
and manipulation can take place.
Modifier and Type | Method and Description |
---|---|
Optional<Transform<World>> |
getTransform()
Gets the
Transform as an Optional as the
Location may be undefined if this EntitySnapshot was
built without a location. |
EntityType |
getType()
Gets the
EntityType . |
Optional<UUID> |
getUniqueId()
|
Optional<Entity> |
restore()
Restores the
EntitySnapshot to the Location stored within
the snapshot. |
getLocation, getPosition, getWorldUniqueId, withLocation
getManipulators
toContainer
getApplicableProperties, getProperty
get, getContainers, getOrCreate, merge, merge, supports, transform, with, with, with, with, without
Optional<UUID> getUniqueId()
Optional
containing the UUID
of the
Entity
that this EntitySnapshot
is representing. If the
Optional
is Optional.empty()
, then this snapshot must
have been created by an EntitySnapshotBuilder
without an
Entity
as a source.Optional<Transform<World>> getTransform()
Transform
as an Optional
as the
Location
may be undefined if this EntitySnapshot
was
built without a location. This method is linked to LocateableSnapshot.getLocation()
such that if there is a Location
, there is usually a
Transform
.EntityType getType()
EntityType
.Optional<Entity> restore()
EntitySnapshot
to the Location
stored within
the snapshot. If the Location
is not available, the snapshot will
not be restored.