Package org.spongepowered.api.world
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 ofDataHolder.Immutablethat may be linked to a particularServerLocation. Being that aLocatableSnapshotmay be built by anDataHolderBuilder.Immutable, theServerLocationmay benullsuch thatlocation()returnsOptional.empty().
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<ServerLocation>location()Gets theServerLocationof the snapshot at which it may have been taken from.Vector3iposition()Gets the saved block position.TwithLocation(ServerLocation location)Creates a copy of the snapshot with the providedServerLocation.ResourceKeyworld()Gets thekeyof the world.-
Methods inherited from interface org.spongepowered.api.data.DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, without
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Immutable
copy, withRawData
-
-
-
-
Method Detail
-
world
ResourceKey world()
Gets thekeyof the world.- Returns:
- The key
-
position
Vector3i position()
Gets the saved block position.- Returns:
- The saved block 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
T withLocation(ServerLocation location)
Creates a copy of the snapshot with the providedServerLocation.- Parameters:
location- The location- Returns:
- The new snapshot
-
-