Class PrefabPathCollection

java.lang.Object
com.hypixel.hytale.builtin.path.PrefabPathCollection

public class PrefabPathCollection extends Object
Created on 22/08/2018
  • Constructor Details

    • PrefabPathCollection

      public PrefabPathCollection(int id)
  • Method Details

    • getNearestPrefabPath

      @Nullable public IPrefabPath getNearestPrefabPath(int nameIndex, @Nonnull org.joml.Vector3d position, Set<UUID> disallowedPaths, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Get the path nearest to the designated position which matches a friendly name
      Parameters:
      nameIndex - the mapped index of the name of the path to search for
      position - the position to compare to
      disallowedPaths - an optional set of paths to exclude by uuid
      componentAccessor - The ComponentAccessor<EntityStore> for component access.
      Returns:
      the closest path
    • getPath

      public IPrefabPath getPath(UUID id)
      Get the exact path by id
      Parameters:
      id - the id of the path
      Returns:
      the path, or null if no matching path exists
    • getOrConstructPath

      public IPrefabPath getOrConstructPath(@Nonnull UUID id, @Nonnull String name, @Nonnull com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap.IntBiObjFunction<UUID, String, IPrefabPath> pathGenerator)
      Get the exact path by id or construct it if it's absent
      Parameters:
      id - the id of the path
      name - the friendly name of the path
      pathGenerator - a generator to create the path if not found
      Returns:
      the path in question, or null if the path does not exist and no generator was specified
    • getNearestPrefabPath

      @Nullable public IPrefabPath getNearestPrefabPath(@Nonnull org.joml.Vector3d position, @Nullable Set<UUID> disallowedPaths, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Get the path nearest to the designated position regardless of naming.
      Parameters:
      position - The position to compare to.
      disallowedPaths - An optional set of paths to exclude by uuid.
      componentAccessor - The ComponentAccessor<EntityStore> for component access.
      Returns:
      the closest path
    • removePathWaypoint

      public void removePathWaypoint(UUID id, int index)
    • unloadPathWaypoint

      public void unloadPathWaypoint(UUID id, int index)
    • removePath

      public void removePath(UUID id)
    • isEmpty

      public boolean isEmpty()
    • forEach

      public void forEach(BiConsumer<UUID, IPrefabPath> consumer)