Interface GridWatcher

All Known Implementing Classes:
AbstractGridContainerMenu, AbstractPortableGridContainerMenu, CraftingGridContainerMenu, GridContainerMenu, PatternGridContainerMenu, PortableGridBlockContainerMenu, PortableGridItemContainerMenu, WirelessGridContainerMenu

@API(status=STABLE, since="2.0.0-milestone.1.0") public interface GridWatcher
A grid listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Usually called when the grid network has been changed.
    void
    onActiveChanged(boolean newActive)
    Called when the activeness state of the grid has changed.
    void
    onChanged(ResourceKey resource, long change, TrackedResource trackedResource)
    Called when a resource is changed.
  • Method Details

    • onActiveChanged

      void onActiveChanged(boolean newActive)
      Called when the activeness state of the grid has changed.
      Parameters:
      newActive - the new activeness state
    • onChanged

      void onChanged(ResourceKey resource, long change, @Nullable TrackedResource trackedResource)
      Called when a resource is changed.
      Parameters:
      resource - the resource
      change - the changed amount
      trackedResource - the tracked resource, if present
    • invalidate

      void invalidate()
      Usually called when the grid network has been changed.