Interface Snapshotable

All Known Subinterfaces:
ServerProcess
All Known Implementing Classes:
Chunk, DynamicChunk, Entity, EntityCreature, EntityProjectile, ExperienceOrb, Instance, InstanceContainer, ItemEntity, LightingChunk, LivingEntity, Player, PlayerProjectile, SharedInstance

@Experimental public interface Snapshotable
Represents an object which is regularly saved into a snapshot.

Implementations must be identity-based.

  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull Snapshot
    updateSnapshot(@NotNull SnapshotUpdater updater)
    Updates the currently cached snapshot if required.
  • Method Details

    • updateSnapshot

      @NotNull default @NotNull Snapshot updateSnapshot(@NotNull @NotNull SnapshotUpdater updater)
      Updates the currently cached snapshot if required. The updater can be used to retrieve references to other snapshots while avoiding circular dependency. Be careful to do not store updater anywhere as its data will change when building requested references.

      This method is not thread-safe, and targeted at internal use since its execution rely on safe-points (e.g. end of ticks)

      Parameters:
      updater - the snapshot updater/context
      Returns:
      the updated snapshot