All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.snapshot.Snapshotable Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.snapshot;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
 * Represents an object which is regularly saved into a snapshot.
 * 

* Implementations must be identity-based. */ @ApiStatus.Experimental public interface Snapshotable { /** * 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 {@code 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) * * @param updater the snapshot updater/context * @return the updated snapshot */ default @NotNull Snapshot updateSnapshot(@NotNull SnapshotUpdater updater) { throw new UnsupportedOperationException("Snapshot is not supported for this object"); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy