Contents
Class RestingSupport
java.lang.Object
com.hypixel.hytale.server.core.modules.physics.RestingSupport
Tracks a snapshot of the attached block ID, allowing the physics system to skip simulation for
resting entities and resume it when the supporting block changes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Called to clear the current block snapshot, disabling change detection until the next call torest(ChunkStore, Vector3i).booleanhasChanged(ChunkStore chunkStore) Called to check whether the attached block has changed since the last call torest(ChunkStore, Vector3i).voidrest(ChunkStore chunkStore, org.joml.Vector3i attachBlock) Called to capture a snapshot of the attached block, establishing the baseline used byhasChanged(ChunkStore)to detect block changes.
-
Constructor Details
-
RestingSupport
public RestingSupport()
-
-
Method Details
-
hasChanged
Called to check whether the attached block has changed since the last call torest(ChunkStore, Vector3i).- Parameters:
chunkStore- TheChunkStoreused to look up the current block data.- Returns:
trueif one or more support blocks have changed,falseotherwise.
-
rest
Called to capture a snapshot of the attached block, establishing the baseline used byhasChanged(ChunkStore)to detect block changes.- Parameters:
chunkStore- TheChunkStoreused to look up the current block data.attachBlock- The block the entity rests against, ornullfor none.
-
clear
public void clear()Called to clear the current block snapshot, disabling change detection until the next call torest(ChunkStore, Vector3i).
-