Skip to content

Delta and Ownership Model

Panayiotis Stylianopoulos edited this page Jul 12, 2026 · 3 revisions

ChunkDelta is the shared state carrier for runtime mutation, persisted chunk payloads, metadata, block entities, and pending entities.

Ownership helpers determine whether a delta is merely attached state or Chunkis-owned authoritative state.

Main Components

  • ChunkDelta stores the shared chunk state.
  • ChunkDeltaOwnership classifies ownership and restorability.
  • GlobalChunkTracker tracks runtime state.
  • PendingVanillaSaveDecision and StoragePreventionMixin coordinate vanilla-write suppression.

Ownership Rules

  • hasChunkisOwnedState(...) means the delta has an ownership claim.
  • hasRestorableChunkisState(...) is broader: replay payloads or persistence anchors are sufficient.
  • GlobalChunkTracker keeps dirty deltas by dimension and chunk position.
  • The unload cache mirrors relevant tracked state.
  • An existing authoritative tracked delta can override an incoming weaker replacement.
  • Vanilla writes are cancelled only when the higher-level save path marked the chunk as Chunkis-owned.

Load and Save Relationship

  • Save persists only Chunkis-owned state.
  • Load restores deltas with replay payloads or persistence anchors.
  • Clean unload-cache deltas are invalidated before load and must not override storage.

Important Caveat

It is incorrect to treat every attached delta as authoritative. Authority is established through explicit ownership and persistence state.

Key Classes

  • common/src/main/java/io/liparakis/chunkis/core/ChunkDelta.java
  • fabric/src/main/java/io/liparakis/chunkis/world/tracking/ownership/ChunkDeltaOwnership.java
  • fabric/src/main/java/io/liparakis/chunkis/world/tracking/state/GlobalChunkTracker.java
  • fabric/src/main/java/io/liparakis/chunkis/mixin/storage/StoragePreventionMixin.java

Clone this wiki locally