Class Role
java.lang.Object
com.hypixel.hytale.server.npc.role.Role
- All Implemented Interfaces:
IAnnotatedComponent,IAnnotatedComponentCollection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.hypixel.hytale.server.npc.movement.controllers.MotionControllerprotected final Stringprotected Stringprotected final booleanprotected String[]protected final Role.AvoidanceModeprotected booleanprotected final Stringprotected final Steeringprotected final booleanprotected final booleanprotected final booleanprotected final doubleprotected final doubleprotected final doubleprotected final floatprotected final floatprotected final CombatSupportprotected final booleanprotected Instructionprotected final doubleprotected Instructionprotected final Stringstatic final booleanprotected final DebugSupportprotected final byteprotected final List<Role.DeferredAction> protected final floatprotected final Stringprotected final doubleprotected final EntitySupportprotected boolean[]protected final String[]protected final doubleprotected int[]protected final String[]protected final booleanprotected final doubleprotected final doubleprotected final doubleprotected final GroupSteeringAccumulatorprotected booleanprotected final Steeringprotected final String[]protected final intprotected final Set<Ref<EntityStore>> protected Instruction[]protected final doubleprotected final intstatic final doubleprotected Instructionprotected final Stringprotected final intprotected final booleanprotected booleanprotected final booleanprotected final booleanprotected final booleanprotected final doubleprotected Instructionprotected Instructionprotected final Vector3dprotected final MarkedEntitySupportprotected final Stringprotected final Stringprotected final String[]protected final intprotected final booleanprotected final PositionCacheprotected booleanprotected booleanprotected intprotected Stringprotected final RoleStatsprotected Instructionprotected final Vector3dprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final floatprotected final StateSupportprotected final booleanprotected final SteeringForceAvoidCollisionprotected final WorldSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeferredAction(Role.DeferredAction handler) voidaddForce(Vector3d velocity, VelocityConfig velocityConfig) voidblendAvoidance(Ref<EntityStore> ref, Vector3d position, Steering steering, CommandBuffer<EntityStore> commandBuffer) voidblendSeparation(Ref<EntityStore> selfRef, Vector3d position, Steering steering, ComponentType<EntityStore, TransformComponent> transformComponentType, CommandBuffer<EntityStore> commandBuffer) booleancanBreathe(BlockMaterial breathingMaterial, int fluidId) voidvoidintprotected voidcomputeActionsAndSteering(Ref<EntityStore> ref, double tickTime, Steering bodySteering, Steering headSteering, Store<EntityStore> store) booleancouldBreathe(BlockMaterial breathingMaterial, int fluidId) booleanvoidforceVelocity(Vector3d velocity, VelocityConfig velocityConfig, boolean ignoreDamping) com.hypixel.hytale.server.npc.movement.controllers.MotionControllerdoubledoublegetComponent(int index) doublefloatString[]doubleint[]intgetIndex()doublevoidgetInfo(Role role, ComponentInfo holder) intdoublegetLabel()intdoublefloatbooleanprivate voidinitialiseInventories(NPCEntity npcComponent) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisFlagSet(int index) booleanbooleanisFriendly(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) booleanisIgnoredForAvoidance(Ref<EntityStore> entityReference) booleanbooleanbooleanisMemory()booleanbooleanbooleanvoidloaded()protected voidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) voidvoidonLoadFromWorldGenOrPrefab(Ref<EntityStore> ref, NPCEntity npcComponent, ComponentAccessor<EntityStore> componentAccessor) voidpostRoleBuilt(BuilderSupport builderSupport) voidprocessAddVelocityInstruction(Vector3d velocity, VelocityConfig velocityConfig) voidprocessSetVelocityInstruction(Vector3d velocity, VelocityConfig velocityConfig) voidremoved()booleanvoidvoidresetInstruction(int instruction) voidsetActiveMotionController(Ref<EntityStore> ref, NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) booleansetActiveMotionController(Ref<EntityStore> ref, NPCEntity npcComponent, String name, ComponentAccessor<EntityStore> componentAccessor) voidvoidsetBackingAway(boolean backingAway) voidsetContext(IAnnotatedComponent parent, int index) voidsetFlag(int index, boolean value) voidsetMarkedTarget(String targetSlot, Ref<EntityStore> target) voidsetMotionControllers(NPCEntity npcComponent, Map<String, com.hypixel.hytale.server.npc.movement.controllers.MotionController> motionControllers, String initialMotionController) voidsetReachedTerminalAction(boolean hasReached) voidvoidsetRoleIndex(int roleIndex, String roleName) voidspawned(Holder<EntityStore> holder, NPCEntity npcComponent) swapTreeModeSteps(Instruction newStep) voidteleported(World from, World to) voidtick(Ref<EntityStore> ref, float tickTime, Store<EntityStore> store) voidunloaded()voidupdateMotionControllers(Ref<EntityStore> ref, Model model, Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) voidupdateMovementState(Ref<EntityStore> ref, MovementStates movementStates, Vector3d velocity, ComponentAccessor<EntityStore> componentAccessor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.server.npc.util.IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs
-
Field Details
-
INTERACTION_PLAYER_DISTANCE
public static final double INTERACTION_PLAYER_DISTANCE- See Also:
-
DEBUG_APPLIED_FORCES
public static final boolean DEBUG_APPLIED_FORCES- See Also:
-
combatSupport
-
stateSupport
-
markedEntitySupport
-
worldSupport
-
entitySupport
-
positionCache
-
debugSupport
-
initialMaxHealth
protected final int initialMaxHealth -
collisionProbeDistance
protected final double collisionProbeDistance -
collisionRadius
protected final double collisionRadius -
collisionForceFalloff
protected final double collisionForceFalloff -
collisionViewAngle
protected final float collisionViewAngle -
collisionViewHalfAngleCosine
protected final float collisionViewHalfAngleCosine -
bodySteering
-
headSteering
-
steeringForceAvoidCollision
-
groupSteeringAccumulator
-
separation
-
ignoredEntitiesForAvoidance
-
entityAvoidanceStrength
protected final double entityAvoidanceStrength -
avoidanceMode
-
isAvoidingEntities
protected final boolean isAvoidingEntities -
separationDistance
protected final double separationDistance -
separationWeight
protected final double separationWeight -
separationDistanceTarget
protected final double separationDistanceTarget -
separationNearRadiusTarget
protected final double separationNearRadiusTarget -
separationFarRadiusTarget
protected final double separationFarRadiusTarget -
applySeparation
protected final boolean applySeparation -
lastSeparationSteering
-
stayInEnvironment
protected final boolean stayInEnvironment -
allowedEnvironments
-
flockSpawnTypes
-
flockSpawnTypesRandom
protected final boolean flockSpawnTypesRandom -
flockAllowedRoles
-
canLeadFlock
protected final boolean canLeadFlock -
flockWeightAlignment
protected final double flockWeightAlignment -
flockWeightSeparation
protected final double flockWeightSeparation -
flockWeightCohesion
protected final double flockWeightCohesion -
flockInfluenceRange
protected final double flockInfluenceRange -
corpseStaysInFlock
protected final boolean corpseStaysInFlock -
inertia
protected final double inertia -
knockbackScale
protected final double knockbackScale -
breathesInAir
protected final boolean breathesInAir -
breathesInWater
protected final boolean breathesInWater -
pickupDropOnDeath
protected final boolean pickupDropOnDeath -
hotbarItems
-
offHandItems
-
deathAnimationTime
protected final double deathAnimationTime -
despawnAnimationTime
protected final float despawnAnimationTime -
dropListId
-
deathInteraction
-
invulnerable
protected final boolean invulnerable -
inventorySlots
protected final int inventorySlots -
inventoryContentsDropList
-
hotbarSlots
protected final int hotbarSlots -
offHandSlots
protected final int offHandSlots -
defaultOffHandSlot
protected final byte defaultOffHandSlot -
deferredActions
-
roleStats
-
balanceAsset
-
interactionVars
-
roleIndex
protected int roleIndex -
roleName
-
appearance
-
isActivated
protected boolean isActivated -
motionControllers
-
activeMotionController
protected com.hypixel.hytale.server.npc.movement.controllers.MotionController activeMotionController -
flockSpawnTypeIndices
protected int[] flockSpawnTypeIndices -
requiresLeashPosition
protected boolean requiresLeashPosition -
hasReachedTerminalAction
protected boolean hasReachedTerminalAction -
armor
-
flags
protected boolean[] flags -
rootInstruction
-
lastBodyMotionStep
-
lastHeadMotionStep
-
indexedInstructions
-
interactionInstruction
-
deathInstruction
-
currentTreeModeStep
-
roleChangeRequested
protected boolean roleChangeRequested -
isMemory
protected final boolean isMemory -
memoriesNameOverride
-
isMemoriesNameOverriden
protected final boolean isMemoriesNameOverriden -
spawnLockTime
protected final float spawnLockTime -
nameTranslationKey
-
backingAway
protected boolean backingAway
-
-
Constructor Details
-
Role
-
-
Method Details
-
getInitialMaxHealth
public int getInitialMaxHealth() -
isAvoidingEntities
public boolean isAvoidingEntities() -
getCollisionProbeDistance
public double getCollisionProbeDistance() -
isApplySeparation
public boolean isApplySeparation() -
getSeparationDistance
public double getSeparationDistance() -
getRootInstruction
-
getInteractionInstruction
-
getDeathInstruction
-
getBodySteering
-
getHeadSteering
-
getIgnoredEntitiesForAvoidance
-
getDropListId
-
getBalanceAsset
-
getInteractionVars
-
isMemory
public boolean isMemory() -
getMemoriesNameOverride
-
getNameTranslationKey
-
isMemoriesNameOverriden
public boolean isMemoriesNameOverriden() -
getSpawnLockTime
public float getSpawnLockTime() -
postRoleBuilt
-
loaded
public void loaded() -
spawned
-
unloaded
public void unloaded() -
removed
public void removed() -
teleported
-
getAppearanceName
-
getActiveMotionController
public com.hypixel.hytale.server.npc.movement.controllers.MotionController getActiveMotionController() -
getCombatSupport
-
getStateSupport
-
getWorldSupport
-
getMarkedEntitySupport
-
getPositionCache
-
getEntitySupport
-
getDebugSupport
-
isRoleChangeRequested
public boolean isRoleChangeRequested() -
setRoleChangeRequested
public void setRoleChangeRequested() -
setActiveMotionController
public boolean setActiveMotionController(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, @Nonnull String name, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
setActiveMotionController
public void setActiveMotionController(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, @Nonnull com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
motionControllerChanged
protected void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, @Nullable com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
setMotionControllers
-
updateMotionControllers
public void updateMotionControllers(@Nullable Ref<EntityStore> ref, @Nullable Model model, @Nullable Box boundingBox, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
updateMovementState
public void updateMovementState(@Nonnull Ref<EntityStore> ref, @Nonnull MovementStates movementStates, @Nonnull Vector3d velocity, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
tick
-
addDeferredAction
-
computeActionsAndSteering
protected void computeActionsAndSteering(@Nonnull Ref<EntityStore> ref, double tickTime, @Nonnull Steering bodySteering, @Nonnull Steering headSteering, @Nonnull Store<EntityStore> store) -
blendSeparation
public void blendSeparation(@Nonnull Ref<EntityStore> selfRef, @Nonnull Vector3d position, @Nonnull Steering steering, @Nonnull ComponentType<EntityStore, TransformComponent> transformComponentType, @Nonnull CommandBuffer<EntityStore> commandBuffer) -
getLastSeparationSteering
-
blendAvoidance
public void blendAvoidance(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d position, @Nonnull Steering steering, @Nonnull CommandBuffer<EntityStore> commandBuffer) -
getLastAvoidanceSteering
-
resetInstruction
public void resetInstruction(int instruction) -
getRoleName
-
getRoleIndex
public int getRoleIndex() -
setRoleIndex
-
isInvulnerable
public boolean isInvulnerable() -
isBreathesInAir
public boolean isBreathesInAir() -
isBreathesInWater
public boolean isBreathesInWater() -
getInertia
public double getInertia() -
getKnockbackScale
public double getKnockbackScale() -
canBreathe
-
couldBreathe
-
couldBreatheCached
public boolean couldBreatheCached() -
addForce
-
forceVelocity
public void forceVelocity(@Nonnull Vector3d velocity, @Nullable VelocityConfig velocityConfig, boolean ignoreDamping) -
processAddVelocityInstruction
public void processAddVelocityInstruction(@Nonnull Vector3d velocity, @Nullable VelocityConfig velocityConfig) -
processSetVelocityInstruction
public void processSetVelocityInstruction(@Nonnull Vector3d velocity, @Nullable VelocityConfig velocityConfig) -
isOnGround
public boolean isOnGround() -
setArmor
-
isPickupDropOnDeath
public boolean isPickupDropOnDeath() -
requiresLeashPosition
public boolean requiresLeashPosition() -
clearOnce
public void clearOnce() -
clearOnceIfNeeded
public void clearOnceIfNeeded() -
setMarkedTarget
-
isFriendly
public boolean isFriendly(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
isIgnoredForAvoidance
-
getAvoidanceMode
-
getCollisionRadius
public double getCollisionRadius() -
getFlockSpawnTypes
public int[] getFlockSpawnTypes() -
getFlockAllowedRoles
-
isFlockSpawnTypesRandom
public boolean isFlockSpawnTypesRandom() -
isCanLeadFlock
public boolean isCanLeadFlock() -
getFlockInfluenceRange
public double getFlockInfluenceRange() -
getDeathAnimationTime
public double getDeathAnimationTime() -
getDeathInteraction
-
getDespawnAnimationTime
public float getDespawnAnimationTime() -
setReachedTerminalAction
public void setReachedTerminalAction(boolean hasReached) -
hasReachedTerminalAction
public boolean hasReachedTerminalAction() -
setFlag
public void setFlag(int index, boolean value) -
isFlagSet
public boolean isFlagSet(int index) -
isBackingAway
public boolean isBackingAway() -
setBackingAway
public void setBackingAway(boolean backingAway) -
swapTreeModeSteps
-
notifySensorMatch
public void notifySensorMatch() -
resetAllInstructions
public void resetAllInstructions() -
getSteeringMotionName
-
componentCount
public int componentCount()- Specified by:
componentCountin interfaceIAnnotatedComponentCollection
-
getComponent
- Specified by:
getComponentin interfaceIAnnotatedComponentCollection
-
getInfo
- Specified by:
getInfoin interfaceIAnnotatedComponent
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceIAnnotatedComponent
-
setContext
- Specified by:
setContextin interfaceIAnnotatedComponent
-
getParent
- Specified by:
getParentin interfaceIAnnotatedComponent
-
getLabel
- Specified by:
getLabelin interfaceIAnnotatedComponent
-
initialiseInventories
-
isCorpseStaysInFlock
public boolean isCorpseStaysInFlock() -
onLoadFromWorldGenOrPrefab
public void onLoadFromWorldGenOrPrefab(@Nonnull Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getRoleStats
-