Class TeleportedEntityRelationDFS
java.lang.Object
org.sgrewritten.stargate.network.portal.TeleportedEntityRelationDFS
A somewhat altered DFS used to find entities involved in a teleportation
-
Constructor Summary
ConstructorDescriptionTeleportedEntityRelationDFS
(Function<org.bukkit.entity.Entity, Boolean> permissionFunction, List<org.bukkit.entity.LivingEntity> nearbyLeashedEntities) Instantiates a new entity relation Depth-First-Search -
Method Summary
Modifier and TypeMethodDescriptionboolean
depthFirstSearch
(org.bukkit.entity.Entity node) Does a deep first searchSet
<org.bukkit.entity.Entity> Gets all entities found during the last call to depthFirstSearch
-
Constructor Details
-
TeleportedEntityRelationDFS
public TeleportedEntityRelationDFS(Function<org.bukkit.entity.Entity, Boolean> permissionFunction, List<org.bukkit.entity.LivingEntity> nearbyLeashedEntities) Instantiates a new entity relation Depth-First-Search- Parameters:
permissionFunction
-The permission function to use for checking permissions of an entity
nearbyLeashedEntities
-The nearby leashed entities to consider part of the teleportation
-
-
Method Details
-
depthFirstSearch
public boolean depthFirstSearch(org.bukkit.entity.Entity node) Does a deep first search- Parameters:
node
-The entity to run the dept-first-search
- Returns:
If the teleportation should proceed
-
getEntitiesToTeleport
Gets all entities found during the last call to depthFirstSearch- Returns:
All entities found during the search
-