Class SensorEntityBase
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.SensorBase
com.hypixel.hytale.server.npc.corecomponents.SensorWithEntityFilters
com.hypixel.hytale.server.npc.corecomponents.entity.SensorEntityBase
- All Implemented Interfaces:
RoleStateChange,Sensor,IAnnotatedComponent,IAnnotatedComponentCollection,IComponentExecutionControl
- Direct Known Subclasses:
SensorEntity,SensorPlayer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final ISensorEntityCollectorprotected static final ComponentType<EntityStore, DeathComponent> protected final intprotected final intprotected final booleanprivate static final com.hypixel.hytale.logger.HytaleLoggerprotected final doubleprotected static final ComponentType<EntityStore, NPCEntity> protected IEntityByPriorityFilterprotected final booleanprotected intprotected static final ComponentType<EntityStore, Player> protected IEntityByPriorityFilterprotected final EntityPositionProviderprotected final ISensorEntityPrioritiserprotected final doubleprotected static final ComponentType<EntityStore, TransformComponent> protected final booleanFields inherited from class com.hypixel.hytale.server.npc.corecomponents.SensorBase
once, triggeredFields inherited from class com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
index, parent -
Constructor Summary
ConstructorsConstructorDescriptionSensorEntityBase(BuilderSensorEntityBase builder, ISensorEntityPrioritiser prioritiser, BuilderSupport builderSupport) -
Method Summary
Modifier and TypeMethodDescriptionvoiddone()protected booleanfilterEntity(Ref<EntityStore> ref, Ref<EntityStore> targetRef, Role role, Store<EntityStore> store) protected booleanfilterEntityWithRange(Ref<EntityStore> ref, Ref<EntityStore> targetRef, Vector3d position, Role role, Store<EntityStore> store) protected Ref<EntityStore> filterLockedEntity(Ref<EntityStore> ref, Vector3d position, Role role, Store<EntityStore> store) protected booleanfilterPrioritisedEntity(Ref<EntityStore> ref, Ref<EntityStore> targetRef, Role role, Store<EntityStore> store, IEntityByPriorityFilter playerPrioritiser) protected booleanfilterPrioritisedNPC(Ref<EntityStore> ref, Ref<EntityStore> targetRef, Role role, Store<EntityStore> store) protected booleanfilterPrioritisedPlayer(Ref<EntityStore> ref, Ref<EntityStore> targetRef, Role role, Store<EntityStore> store) protected Ref<EntityStore> findPlayerOrEntity(Ref<EntityStore> ref, Vector3d position, Role role, Store<EntityStore> store) protected voidprotected booleanprotected abstract booleanprotected abstract booleanvoidbooleanmatches(Ref<EntityStore> ref, Role role, double dt, Store<EntityStore> store) voidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) voidregisterWithSupport(Role role) voidvoidvoidteleported(Role role, World from, World to) voidMethods inherited from class com.hypixel.hytale.server.npc.corecomponents.SensorWithEntityFilters
componentCount, getComponent, matchesFilters, setContextMethods inherited from class com.hypixel.hytale.server.npc.corecomponents.SensorBase
clearOnce, isTriggered, processDelay, setOnceMethods inherited from class com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
getIndex, getInfo, getParentMethods 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, getIndex, getInfo, getLabel, getParent
-
Field Details
-
LOGGER
private static final com.hypixel.hytale.logger.HytaleLogger LOGGER -
TRANSFORM_COMPONENT_TYPE
-
NPC_COMPONENT_TYPE
-
PLAYER_COMPONENT_TYPE
-
DEATH_COMPONENT_TYPE
-
range
protected final double range -
minRange
protected final double minRange -
useProjectedDistance
protected final boolean useProjectedDistance -
lockOnTarget
protected final boolean lockOnTarget -
autoUnlockTarget
protected final boolean autoUnlockTarget -
onlyLockedTarget
protected final boolean onlyLockedTarget -
lockedTargetSlot
protected final int lockedTargetSlot -
ignoredTargetSlot
protected final int ignoredTargetSlot -
prioritiser
-
npcPrioritiser
-
playerPrioritiser
-
collector
-
ownRole
protected int ownRole -
positionProvider
-
-
Constructor Details
-
SensorEntityBase
public SensorEntityBase(@Nonnull BuilderSensorEntityBase builder, ISensorEntityPrioritiser prioritiser, @Nonnull BuilderSupport builderSupport)
-
-
Method Details
-
matches
public boolean matches(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Store<EntityStore> store) - Specified by:
matchesin interfaceSensor- Overrides:
matchesin classSensorBase
-
done
public void done() -
getSensorInfo
-
registerWithSupport
- Specified by:
registerWithSupportin interfaceRoleStateChange- Overrides:
registerWithSupportin classSensorWithEntityFilters
-
motionControllerChanged
public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) - Specified by:
motionControllerChangedin interfaceRoleStateChange- Overrides:
motionControllerChangedin classSensorWithEntityFilters
-
loaded
- Specified by:
loadedin interfaceRoleStateChange- Overrides:
loadedin classSensorWithEntityFilters
-
spawned
- Specified by:
spawnedin interfaceRoleStateChange- Overrides:
spawnedin classSensorWithEntityFilters
-
unloaded
- Specified by:
unloadedin interfaceRoleStateChange- Overrides:
unloadedin classSensorWithEntityFilters
-
removed
- Specified by:
removedin interfaceRoleStateChange- Overrides:
removedin classSensorWithEntityFilters
-
teleported
- Specified by:
teleportedin interfaceRoleStateChange- Overrides:
teleportedin classSensorWithEntityFilters
-
initialisePrioritiser
protected void initialisePrioritiser() -
isGetPlayers
protected abstract boolean isGetPlayers() -
isGetNPCs
protected abstract boolean isGetNPCs() -
isExcludingOwnType
protected boolean isExcludingOwnType() -
filterLockedEntity
@Nullable protected Ref<EntityStore> filterLockedEntity(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d position, @Nonnull Role role, @Nonnull Store<EntityStore> store) -
filterEntityWithRange
protected boolean filterEntityWithRange(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull Vector3d position, @Nonnull Role role, @Nonnull Store<EntityStore> store) -
filterEntity
protected boolean filterEntity(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull Role role, @Nonnull Store<EntityStore> store) -
filterPrioritisedPlayer
protected boolean filterPrioritisedPlayer(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull Role role, @Nonnull Store<EntityStore> store) -
filterPrioritisedNPC
protected boolean filterPrioritisedNPC(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull Role role, @Nonnull Store<EntityStore> store) -
filterPrioritisedEntity
protected boolean filterPrioritisedEntity(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull Role role, @Nonnull Store<EntityStore> store, @Nonnull IEntityByPriorityFilter playerPrioritiser) -
findPlayerOrEntity
@Nullable protected Ref<EntityStore> findPlayerOrEntity(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d position, @Nonnull Role role, @Nonnull Store<EntityStore> store)
-