Contents
Class PathManager
java.lang.Object
com.hypixel.hytale.server.npc.entities.PathManager
The path manager associated with an NPC, which handles setting and fetching the current path of the NPC entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<PathManager> The codec used to parsePathManagerinstances -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIPath<?> getPath(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Called to fetch the current path that the NPC is on.booleanDetermines whether the NPC is currently following a path.voidsetPrefabPath(UUID currentPath, IPrefabPath path) Called to set the current path based on the given prefab path.voidsetTransientPath(IPath<?> path) Called to set the current path based on the given transient path.
-
Field Details
-
CODEC
The codec used to parsePathManagerinstances
-
-
Constructor Details
-
PathManager
public PathManager()
-
-
Method Details
-
setPrefabPath
Called to set the current path based on the given prefab path.- Parameters:
currentPath- TheUUIDof the current path.path- The given prefab path instance to set.
-
setTransientPath
Called to set the current path based on the given transient path.- Parameters:
path- The given path instance to set.
-
isFollowingPath
public boolean isFollowingPath()Determines whether the NPC is currently following a path.- Returns:
trueif the NPC is following a path,falseotherwise.
-
getCurrentPathHint
-
getPath
@Nullable public IPath<?> getPath(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to fetch the current path that the NPC is on.- Parameters:
ref- The entity reference of the NPC entity.componentAccessor- TheComponentAccessorfor component access.- Returns:
- the
IPathinstance of the current path, ornullif not set.
-