Interface Trackable

All Known Implementing Classes:
SlotContainer

public interface Trackable
A mutable value that reports its own changes. When a holder stores one, it listens, so editing the value in place (like a SlotContainer's slots) saves and syncs it without a call to AttachmentHolder.markDirty(net.ixdarklord.coolcatcore.api.attachment.Attachment<?>).

Trackable values can't be stored on item stacks: stack data must be immutable.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setChangeListener(@Nullable Runnable listener)
    Called by the holder storing this value; call listener after every change.
  • Method Details

    • setChangeListener

      void setChangeListener(@Nullable @Nullable Runnable listener)
      Called by the holder storing this value; call listener after every change. null unbinds.