Contents
Class NPCFlockCommand
java.lang.Object
com.hypixel.hytale.server.core.command.system.AbstractCommand
com.hypixel.hytale.server.core.command.system.basecommands.AbstractAsyncCommand
com.hypixel.hytale.server.core.command.system.basecommands.AbstractCommandCollection
com.hypixel.hytale.server.flock.commands.NPCFlockCommand
A command collection for managing NPC flocks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA command that adds NPCs to the player's flock.static classA command that makes the player join an NPC's flock.static classA command that removes NPCs from flocks.static classA command that makes the player leave their flock.Nested classes/interfaces inherited from class AbstractCommand
AbstractCommand.SuggestionOverrideEntry -
Field Summary
Fields inherited from class AbstractCommand
EMPTY_STRING_ARRAY, LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleananyEntityInViewCone(Ref<EntityStore> playerReference, Store<EntityStore> store, Predicate<Ref<EntityStore>> predicate) Checks if any entity in the player's view cone satisfies the given predicate.static intforNpcEntitiesInViewCone(Ref<EntityStore> playerReference, Store<EntityStore> store, BiPredicate<Ref<EntityStore>, NPCEntity> predicate) Iterates through NPCs in the player's view cone and applies a predicate to each.Methods inherited from class AbstractCommandCollection
getFullUsage, getUsageString, isNoArgVariantMethods inherited from class AbstractAsyncCommand
runAsyncMethods inherited from class AbstractCommand
acceptCall, addAliases, addSubCommand, addUsageVariant, completeRegistration, countParents, getAliases, getDescription, getFullyQualifiedName, getName, getOptionalArgument, getOptionalArguments, getOwner, getPermission, getPermissionGroups, getPermissionGroupsRecursive, getRequiredArguments, getSubCommand, getSubCommands, getSuggestionOverrides, getUsageShort, getVariantByArgCount, getVariantCommands, hasBeenRegistered, hasPermission, isVariant, matches, putRecursivePermissionGroups, requireNoPermission, requirePermission, requirePermission, setAllowsExtraArguments, setOwner, withDefaultArg, withDefaultArg, withFlagArg, withListDefaultArg, withListOptionalArg, withListRequiredArg, withOptionalArg, withOptionalArg, withRequiredArg, withRequiredArg
-
Constructor Details
-
NPCFlockCommand
public NPCFlockCommand()Default Constructor for anNPCFlockCommandinstance.
-
-
Method Details
-
forNpcEntitiesInViewCone
public static int forNpcEntitiesInViewCone(@Nonnull Ref<EntityStore> playerReference, @Nonnull Store<EntityStore> store, @Nonnull BiPredicate<Ref<EntityStore>, NPCEntity> predicate) Iterates through NPCs in the player's view cone and applies a predicate to each.- Parameters:
playerReference- The player's entity reference.store- The entity store.predicate- The predicate to test on each NPC.- Returns:
- the number of NPCs that matched the predicate.
-
anyEntityInViewCone
public static boolean anyEntityInViewCone(@Nonnull Ref<EntityStore> playerReference, @Nonnull Store<EntityStore> store, @Nonnull Predicate<Ref<EntityStore>> predicate) Checks if any entity in the player's view cone satisfies the given predicate.- Parameters:
playerReference- The entity reference of the player entity.store- The entity store for component access.predicate- The predicate to test entities against.- Returns:
trueif any entity satisfies the predicate,falseotherwise.
-