Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getNearestPrefabPath(int, Vector3d, Set, ComponentAccessor)
- getPath(UUID)
- getOrConstructPath(UUID, String, Int2ObjectConcurrentHashMap.IntBiObjFunction)
- getNearestPrefabPath(Vector3d, Set, ComponentAccessor)
- removePathWaypoint(UUID, int)
- unloadPathWaypoint(UUID, int)
- removePath(UUID)
- isEmpty()
- forEach(BiConsumer)
Class PrefabPathCollection
java.lang.Object
com.hypixel.hytale.builtin.path.PrefabPathCollection
Created on 22/08/2018
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforEach(BiConsumer<UUID, IPrefabPath> consumer) getNearestPrefabPath(int nameIndex, org.joml.Vector3d position, Set<UUID> disallowedPaths, ComponentAccessor<EntityStore> componentAccessor) Get the path nearest to the designated position which matches a friendly namegetNearestPrefabPath(org.joml.Vector3d position, Set<UUID> disallowedPaths, ComponentAccessor<EntityStore> componentAccessor) Get the path nearest to the designated position regardless of naming.getOrConstructPath(UUID id, String name, com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap.IntBiObjFunction<UUID, String, IPrefabPath> pathGenerator) Get the exact path by id or construct it if it's absentGet the exact path by idbooleanisEmpty()voidremovePath(UUID id) voidremovePathWaypoint(UUID id, int index) voidunloadPathWaypoint(UUID id, int index)
-
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 forposition- the position to compare todisallowedPaths- an optional set of paths to exclude by uuidcomponentAccessor- TheComponentAccessor<EntityStore>for component access.- Returns:
- the closest path
-
getPath
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 pathname- the friendly name of the pathpathGenerator- 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- TheComponentAccessor<EntityStore>for component access.- Returns:
- the closest path
-
removePathWaypoint
-
unloadPathWaypoint
-
removePath
-
isEmpty
public boolean isEmpty() -
forEach
-