Class BlockTracker

java.lang.Object
com.hypixel.hytale.server.core.modules.collision.BlockTracker
All Implemented Interfaces:
IBlockTracker
Direct Known Subclasses:
CollisionTracker

public class BlockTracker extends Object implements IBlockTracker
Since:
2020-07-07
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return number of positions stored in tracker.
    int
    getIndex(int x, int y, int z)
     
    org.joml.Vector3i
    getPosition(int index)
    Return a previously stored block position.
    boolean
    isTracked(int x, int y, int z)
    Test if a block position is stored in tracker.
    void
     
    boolean
    track(int x, int y, int z)
    Record a block position in tracker.
    void
    trackNew(int x, int y, int z)
    Record a new block position in tracker.
    void
    untrack(int index)
     
    void
    untrack(int x, int y, int z)
    Remove a block position from tracker if it was stored before.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BlockTracker

      public BlockTracker()
  • Method Details

    • getPosition

      public org.joml.Vector3i getPosition(int index)
      Description copied from interface: IBlockTracker
      Return a previously stored block position.
      Specified by:
      getPosition in interface IBlockTracker
      Parameters:
      index - Index of position to retrieve (between 0 and IBlockTracker.getCount()
      Returns:
      Block position.
    • getCount

      public int getCount()
      Description copied from interface: IBlockTracker
      Return number of positions stored in tracker.
      Specified by:
      getCount in interface IBlockTracker
      Returns:
      Number of position stored.
    • reset

      public void reset()
    • track

      public boolean track(int x, int y, int z)
      Description copied from interface: IBlockTracker
      Record a block position in tracker.
      Specified by:
      track in interface IBlockTracker
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
      Returns:
      True if this position was stored before else false.
    • trackNew

      public void trackNew(int x, int y, int z)
      Description copied from interface: IBlockTracker
      Record a new block position in tracker.

      There is no check done if the position was previously stored in the tracker. Storing position multiple times will corrupt functionality!

      Specified by:
      trackNew in interface IBlockTracker
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
    • isTracked

      public boolean isTracked(int x, int y, int z)
      Description copied from interface: IBlockTracker
      Test if a block position is stored in tracker.
      Specified by:
      isTracked in interface IBlockTracker
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
      Returns:
      True if this position was stored before else false.
    • untrack

      public void untrack(int x, int y, int z)
      Description copied from interface: IBlockTracker
      Remove a block position from tracker if it was stored before.
      Specified by:
      untrack in interface IBlockTracker
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
    • untrack

      public void untrack(int index)
    • getIndex

      public int getIndex(int x, int y, int z)