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.
      The key
    • position

      Vector3i position()
      Gets the saved block position.
      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.
      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.
      location - The location
      The new snapshot