Class TeleportedEntityRelationDFS

java.lang.Object
org.sgrewritten.stargate.network.portal.TeleportedEntityRelationDFS

public class TeleportedEntityRelationDFS extends Object
A somewhat altered DFS used to find entities involved in a teleportation
  • 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

      public Set<org.bukkit.entity.Entity> getEntitiesToTeleport()
      Gets all entities found during the last call to depthFirstSearch
      Returns:

      All entities found during the search