public interface EntitySnapshot extends LocatableSnapshot<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 | Interface and Description |
---|---|
static interface |
EntitySnapshot.Builder
An
ImmutableDataBuilder for building EntitySnapshot s. |
Modifier and Type | Method and Description |
---|---|
static EntitySnapshot.Builder |
builder()
Creates a new
EntitySnapshot.Builder to build an EntitySnapshot . |
EntityArchetype |
createArchetype()
Creates a new
EntityArchetype for use with Schematic s and
placing the archetype in multiple locations. |
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
getContentVersion, toContainer
getApplicableProperties, getProperty
get, getContainers, getOrCreate, merge, merge, supports, transform, with, with, with, with, without
static EntitySnapshot.Builder builder()
EntitySnapshot.Builder
to build an EntitySnapshot
.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 EntitySnapshot.Builder
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 LocatableSnapshot.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.EntityArchetype createArchetype()
EntityArchetype
for use with Schematic
s and
placing the archetype in multiple locations.