Interface SubContainerHolderAccessor<S extends Tracked<K>,K extends WorldKey>

Type Parameters:
S - the type of tracked entities being managed, which extends Tracked
K - the type of the key associated with the tracked entities, which extends WorldKey
All Known Implementing Classes:
ChunkBlockContainer, ChunkSectionBlockContainer, WorldBlockContainer

public interface SubContainerHolderAccessor<S extends Tracked<K>,K extends WorldKey>
Common accessor contract for containers that store Holder instances at three-dimensional block coordinates, regardless of how they are internally organized.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    getHolder(int x, int y, int z)
    Retrieves the tracked object at the given block coordinates.
    void
    removeHolder(int x, int y, int z)
    Removes the tracked object at the given block coordinates, if any.
    void
    setHolder(int x, int y, int z, S holder)
    Stores a tracked object at the given block coordinates.
  • Method Details

    • getHolder

      S getHolder(int x, int y, int z)
      Retrieves the tracked object at the given block coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      the tracked object at the given coordinates, or null if none is present
    • setHolder

      void setHolder(int x, int y, int z, S holder)
      Stores a tracked object at the given block coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      holder - the tracked object to store
    • removeHolder

      void removeHolder(int x, int y, int z)
      Removes the tracked object at the given block coordinates, if any.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • getAllHolders

      Collection<Holder<S,K>> getAllHolders()
      Returns:
      a collection of all holders currently stored in this container