Interface LocatableSnapshot<T extends LocatableSnapshot<T>>
- Type Parameters:
T- The type of location snapshot for self referencing
- All Superinterfaces:
CopyableDataHolder, DataHolder, DataHolder.Immutable<T>, DataSerializable, SerializableDataHolder, SerializableDataHolder.Immutable<T>, ValueContainer
- All Known Subinterfaces:
BlockSnapshot, EntitySnapshot
public interface LocatableSnapshot<T extends LocatableSnapshot<T>>
extends SerializableDataHolder.Immutable<T>
A type of
DataHolder.Immutable that may be linked to a particular
ServerLocation. Being that a LocatableSnapshot may be built
by an DataHolderBuilder.Immutable, the ServerLocation may be
null such that location() returns
Optional.empty().-
Nested Class Summary
Nested classes/interfaces inherited from interface DataHolder
DataHolder.Immutable<I>, DataHolder.MutableNested classes/interfaces inherited from interface SerializableDataHolder
SerializableDataHolder.Immutable<I>, SerializableDataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionlocation()Gets theServerLocationof the snapshot at which it may have been taken from.position()Gets the saved block position.withLocation(ServerLocation location) Creates a copy of the snapshot with the providedServerLocation.world()Gets thekeyof the world.Methods inherited from interface DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, withoutMethods inherited from interface DataSerializable
contentVersion, toContainer, toViewMethods inherited from interface SerializableDataHolder
validateRawDataMethods inherited from interface SerializableDataHolder.Immutable
copy, withRawDataMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supports
-
Method Details
-
world
-
position
-
location
Optional<ServerLocation> location()Gets theServerLocationof the snapshot at which it may have been taken from. TheServerLocationbeing immutable signifies that theLocatableSnapshotcan be re-created at the desiredServerLocation.- Returns:
- The location of where the snapshot was taken, if available
-
withLocation
Creates a copy of the snapshot with the providedServerLocation.- Parameters:
location- The location- Returns:
- The new snapshot
-