@CatalogedBy(value=TeleportHelperFilters.class) public interface TeleportHelperFilter extends CatalogType
TeleportHelperFilter
contains routines to determine whether a
location is a suitable candidate for teleporting to safely.Modifier and Type | Method and Description |
---|---|
boolean |
isSafeBodyMaterial(BlockState blockState)
Tests whether a
BlockState should be considered a safe block
for the body to be inside of. |
boolean |
isSafeFloorMaterial(BlockState blockState)
Tests whether a
BlockState should be considered a safe block
to land on. |
default Tristate |
isValidLocation(World world,
com.flowpowered.math.vector.Vector3i position)
Tests whether the location in question is valid, regardless of whether
the block is safe or not.
|
getId, getName
default Tristate isValidLocation(World world, com.flowpowered.math.vector.Vector3i position)
isSafeFloorMaterial(BlockState)
and
isSafeBodyMaterial(BlockState)
instead, to obtain the full
benefits of the TeleportHelper
.
Tristate.UNDEFINED
denotes that the filter
does not regard the location as valid or otherwise, and that the
helper should determine if the location is suitable using the
isSafeBodyMaterial(BlockState)
and
isSafeFloorMaterial(BlockState)
methods. Implementations
should generally return this result.Tristate.TRUE
marks the location as valid and
will causes the parent TeleportHelper
to return this
location. No checks using isSafeBodyMaterial(BlockState)
and isSafeFloorMaterial(BlockState)
will be performed.Tristate.FALSE
marks the location as invalid
and causes the parent TeleportHelper
to move onto the next
block to check, regardless of whether it would have otherwise been
marked as safe.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.
boolean isSafeFloorMaterial(BlockState blockState)
BlockState
should be considered a safe block
to land on.blockState
- The BlockState
to checktrue
if the material should be safe to land onboolean isSafeBodyMaterial(BlockState blockState)
BlockState
should be considered a safe block
for the body to be inside of.
Generally, you want this to be a passable block!
blockState
- The BlockState
to checktrue
if the material should be safe for the body to
be inside of