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().
  • Method Details

    • world

      ResourceKey world()
      Gets the key of the world.
      Returns:
      The key
    • position

      Vector3i position()
      Gets the saved block position.
      Returns:
      The saved block position
    • location

      Gets the ServerLocation of the snapshot at which it may have been taken from. The ServerLocation being immutable signifies that the LocatableSnapshot can be re-created at the desired ServerLocation.
      Returns:
      The location of where the snapshot was taken, if available
    • withLocation

      T withLocation(ServerLocation location)
      Creates a copy of the snapshot with the provided ServerLocation.
      Parameters:
      location - The location
      Returns:
      The new snapshot