Interface TeleportHelperFilter

All Superinterfaces:
DefaultedRegistryValue

@CatalogedBy(TeleportHelperFilters.class) public interface TeleportHelperFilter extends DefaultedRegistryValue
A TeleportHelperFilter contains routines to determine whether a location is a suitable candidate for teleporting to safely.
  • Method Details

    • isValidLocation

      default Tristate isValidLocation(ServerWorld world, Vector3i position)
      Tests whether the location in question is valid, regardless of whether the block is safe or not. This is only intended to be used by kernels that blacklist/whitelist certain locations, and any block checks should be performed by isSafeFloorMaterial(BlockState) and isSafeBodyMaterial(BlockState) instead, to obtain the full benefits of the TeleportHelper.

      This method has a default implementation of always returning Tristate.UNDEFINED, that is, such a filter is not location specific.

      This will be called before any other check on the target location is performed, this is the first check performed when investigating a location.

      Parameters:
      world - The World to check
      position - The Vector3i (block position) to check
      Returns:
      A Tristate
    • isSafeFloorMaterial

      boolean isSafeFloorMaterial(BlockState blockState)
      Tests whether a BlockState should be considered a safe block to land on.
      Parameters:
      blockState - The BlockState to check
      Returns:
      true if the material should be safe to land on
    • isSafeBodyMaterial

      boolean isSafeBodyMaterial(BlockState blockState)
      Tests whether a BlockState should be considered a safe block for the body to be inside of.

      Generally, you want this to be a passable block!

      Parameters:
      blockState - The BlockState to check
      Returns:
      true if the material should be safe for the body to be inside of