Contents
Class BlockTracker
java.lang.Object
com.hypixel.hytale.server.core.modules.collision.BlockTracker
- All Implemented Interfaces:
IBlockTracker
- Direct Known Subclasses:
CollisionTracker
- Since:
- 2020-07-07
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCount()Return number of positions stored in tracker.intgetIndex(int x, int y, int z) org.joml.Vector3igetPosition(int index) Return a previously stored block position.booleanisTracked(int x, int y, int z) Test if a block position is stored in tracker.voidreset()booleantrack(int x, int y, int z) Record a block position in tracker.voidtrackNew(int x, int y, int z) Record a new block position in tracker.voiduntrack(int index) voiduntrack(int x, int y, int z) Remove a block position from tracker if it was stored before.
-
Field Details
-
NOT_FOUND
public static final int NOT_FOUND- See Also:
-
-
Constructor Details
-
BlockTracker
public BlockTracker()
-
-
Method Details
-
getPosition
public org.joml.Vector3i getPosition(int index) Description copied from interface:IBlockTrackerReturn a previously stored block position.- Specified by:
getPositionin interfaceIBlockTracker- Parameters:
index- Index of position to retrieve (between 0 andIBlockTracker.getCount()- Returns:
- Block position.
-
getCount
public int getCount()Description copied from interface:IBlockTrackerReturn number of positions stored in tracker.- Specified by:
getCountin interfaceIBlockTracker- Returns:
- Number of position stored.
-
reset
public void reset() -
track
public boolean track(int x, int y, int z) Description copied from interface:IBlockTrackerRecord a block position in tracker.- Specified by:
trackin interfaceIBlockTracker- Parameters:
x- X coordinatey- Y coordinatez- 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:IBlockTrackerRecord 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:
trackNewin interfaceIBlockTracker- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate
-
isTracked
public boolean isTracked(int x, int y, int z) Description copied from interface:IBlockTrackerTest if a block position is stored in tracker.- Specified by:
isTrackedin interfaceIBlockTracker- Parameters:
x- X coordinatey- Y coordinatez- 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:IBlockTrackerRemove a block position from tracker if it was stored before.- Specified by:
untrackin interfaceIBlockTracker- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate
-
untrack
public void untrack(int index) -
getIndex
public int getIndex(int x, int y, int z)
-