Class RestingSupport

java.lang.Object
com.hypixel.hytale.server.core.modules.physics.RestingSupport

public class RestingSupport extends Object
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 Details

    • RestingSupport

      public RestingSupport()
  • Method Details

    • hasChanged

      public boolean hasChanged(@Nonnull ChunkStore chunkStore)
      Called to check whether the attached block has changed since the last call to rest(ChunkStore, Vector3i).
      Parameters:
      chunkStore - The ChunkStore used to look up the current block data.
      Returns:
      true if one or more support blocks have changed, false otherwise.
    • rest

      public void rest(@Nonnull ChunkStore chunkStore, @Nullable org.joml.Vector3i attachBlock)
      Called to capture a snapshot of the attached block, establishing the baseline used by hasChanged(ChunkStore) to detect block changes.
      Parameters:
      chunkStore - The ChunkStore used to look up the current block data.
      attachBlock - The block the entity rests against, or null for none.
    • clear

      public void clear()
      Called to clear the current block snapshot, disabling change detection until the next call to rest(ChunkStore, Vector3i).