NPCEntity

public class NPCEntity extends LivingEntity implements INonPlayerCharacter

Class NPCEntity. Provides npcentity functionality for the Hytale server.

java.lang.Object > LivingEntity > NPCEntity

Field Summary

roleName

private String roleName

Field roleName.

roleIndex

private int roleIndex

Field roleIndex.

role

private Role role

Field role.

spawnRoleIndex

private int spawnRoleIndex

Field spawnRoleIndex.

spawnRoleName

private String spawnRoleName

Field spawnRoleName.

spawnConfigurationName

private String spawnConfigurationName

Field spawnConfigurationName.

environmentIndex

private int environmentIndex

Field environmentIndex.

spawnConfigurationIndex

private int spawnConfigurationIndex

Field spawnConfigurationIndex.

isSpawnTracked

private boolean isSpawnTracked

Field isSpawnTracked.

isDespawning

private boolean isDespawning

Field isDespawning.

isPlayingDespawnAnim

private boolean isPlayingDespawnAnim

Field isPlayingDespawnAnim.

despawnRemainingSeconds

private float despawnRemainingSeconds

Field despawnRemainingSeconds.

despawnCheckRemainingSeconds

private float despawnCheckRemainingSeconds

Field despawnCheckRemainingSeconds.

despawnAnimationRemainingSeconds

private float despawnAnimationRemainingSeconds

Field despawnAnimationRemainingSeconds.

cachedEntityHorizontalSpeedMultiplier

private float cachedEntityHorizontalSpeedMultiplier

Field cachedEntityHorizontalSpeedMultiplier.

leashHeading

private float leashHeading

Field leashHeading.

leashPitch

private float leashPitch

Field leashPitch.

hasLeashPosition

private boolean hasLeashPosition

Field hasLeashPosition.

hoverPhase

private float hoverPhase

Field hoverPhase.

hoverHeight

private double hoverHeight

Field hoverHeight.

initialModelScale

private float initialModelScale

Field initialModelScale.

spawnInstant

private Instant spawnInstant

Field spawnInstant.

pathManager

private PathManager pathManager

Field pathManager.

blackboardBlockTypeView

private BlockTypeView blackboardBlockTypeView

Field blackboardBlockTypeView.

blackboardBlockTypeSets

private IntList blackboardBlockTypeSets

Field blackboardBlockTypeSets.

blackboardBlockChangeView

private BlockEventView blackboardBlockChangeView

Field blackboardBlockChangeView.

blackboardEntityEventView

private EntityEventView blackboardEntityEventView

Field blackboardEntityEventView.

alarmStore

private AlarmStore alarmStore

Field alarmStore.

worldgenId

private int worldgenId

Field worldgenId.

modelComponent

final ModelComponent modelComponent

Field modelComponent.

activeAnimationComponent

final ActiveAnimationComponent activeAnimationComponent

Field activeAnimationComponent.

activeAnimations

final String[] activeAnimations

Field activeAnimations.

view

final BlockTypeView view

Field view.

store

final Store store

Field store.

initiator

final Ref initiator

Field initiator.

isPlayer

final boolean isPlayer

Field isPlayer.

name

final String name

Field name.

oldState

final boolean oldState

Field oldState.

model

final Model model

Field model.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

modelAsset

final ModelAsset modelAsset

Field modelAsset.

effectControllerComponent

final EffectControllerComponent effectControllerComponent

Field effectControllerComponent.

cachedEffectIndexes

final int[] cachedEffectIndexes

Field cachedEffectIndexes.

effect

final EntityEffect effect

Field effect.

applicationEffects

final ApplicationEffects applicationEffects

Field applicationEffects.

multiplier

final float multiplier

Field multiplier.

Method Detail

getComponentType

public NPCEntity> getComponentType ()

Method getComponentType.

NPCEntity

public public NPCEntity ()

Method NPCEntity.

getAlarmStore

public AlarmStore getAlarmStore ()

Method getAlarmStore.

createDefaultInventory

protected Inventory createDefaultInventory ()

Method createDefaultInventory.

Inventory

public new Inventory ((short)

Method Inventory.

Parameters:
(short (short

getRole

public Role getRole ()

Method getRole.

invalidateCachedHorizontalSpeedMultiplier

public void invalidateCachedHorizontalSpeedMultiplier ()

Method invalidateCachedHorizontalSpeedMultiplier.

storeTickStartPosition

public void storeTickStartPosition (@Nonnull final Vector3d position)

Method storeTickStartPosition.

Parameters:
@Nonnull final Vector3d position

tickDespawnAnimationRemainingSeconds

public boolean tickDespawnAnimationRemainingSeconds (final float dt)

Method tickDespawnAnimationRemainingSeconds.

Parameters:
final float dt

setDespawnAnimationRemainingSeconds

public void setDespawnAnimationRemainingSeconds (final float seconds)

Method setDespawnAnimationRemainingSeconds.

Parameters:
final float seconds

tickDespawnRemainingSeconds

public boolean tickDespawnRemainingSeconds (final float dt)

Method tickDespawnRemainingSeconds.

Parameters:
final float dt

setDespawnRemainingSeconds

public void setDespawnRemainingSeconds (final float seconds)

Method setDespawnRemainingSeconds.

Parameters:
final float seconds

setDespawning

public void setDespawning (final boolean despawning)

Method setDespawning.

Parameters:
final boolean despawning

setPlayingDespawnAnim

public void setPlayingDespawnAnim (final boolean playingDespawnAnim)

Method setPlayingDespawnAnim.

Parameters:
final boolean playingDespawnAnim

tickDespawnCheckRemainingSeconds

public boolean tickDespawnCheckRemainingSeconds (final float dt)

Method tickDespawnCheckRemainingSeconds.

Parameters:
final float dt

setDespawnCheckRemainingSeconds

public void setDespawnCheckRemainingSeconds (final float seconds)

Method setDespawnCheckRemainingSeconds.

Parameters:
final float seconds

setInitialModelScale

public void setInitialModelScale (final float scale)

Method setInitialModelScale.

Parameters:
final float scale

getOldPosition

public Vector3d getOldPosition ()

Method getOldPosition.

playAnimation

public void playAnimation (@Nonnull final Ref ref, @Nonnull final AnimationSlot animationSlot, @Nullable final String animationId, @Nonnull final ComponentAccessor componentAccessor)

Method playAnimation.

Parameters:
@Nonnull final Ref ref
@Nonnull final AnimationSlot animationSlot
@Nullable final String animationId
@Nonnull final ComponentAccessor componentAccessor

clearDamageData

public void clearDamageData ()

Method clearDamageData.

setToDespawn

public void setToDespawn ()

Method setToDespawn.

setDespawnTime

public void setDespawnTime (final float time)

Method setDespawnTime.

Parameters:
final float time

getDespawnTime

public double getDespawnTime ()

Method getDespawnTime.

canBreathe

public boolean canBreathe (@Nonnull final Ref ref, @Nonnull final BlockMaterial breathingMaterial, final int fluidId, @Nonnull final ComponentAccessor componentAccessor)

Method canBreathe.

Parameters:
@Nonnull final Ref ref
@Nonnull final BlockMaterial breathingMaterial
final int fluidId
@Nonnull final ComponentAccessor componentAccessor

getDamageData

public DamageData getDamageData ()

Method getDamageData.

getCanCauseDamage

public boolean getCanCauseDamage (@Nonnull final Ref attackerRef, @Nonnull final ComponentAccessor componentAccessor)

Method getCanCauseDamage.

Parameters:
@Nonnull final Ref attackerRef
@Nonnull final ComponentAccessor componentAccessor

onFlockSetState

public void onFlockSetState (@Nonnull final Ref ref, @Nonnull final String state, @Nullable final String subState, @Nonnull final ComponentAccessor componentAccessor)

Method onFlockSetState.

Parameters:
@Nonnull final Ref ref
@Nonnull final String state
@Nullable final String subState
@Nonnull final ComponentAccessor componentAccessor

onFlockSetTarget

public void onFlockSetTarget (@Nonnull final String targetSlot, @Nonnull final Ref target)

Method onFlockSetTarget.

Parameters:
@Nonnull final String targetSlot
@Nonnull final Ref target

saveLeashInformation

public void saveLeashInformation (@Nonnull final Vector3d position, @Nonnull final Vector3f rotation)

Method saveLeashInformation.

Parameters:
@Nonnull final Vector3d position
@Nonnull final Vector3f rotation

saveLeashBlockType

public void saveLeashBlockType ()

Method saveLeashBlockType.

requiresLeashPosition

public boolean requiresLeashPosition ()

Method requiresLeashPosition.

getLeashPoint

public Vector3d getLeashPoint ()

Method getLeashPoint.

setLeashPoint

public void setLeashPoint (@Nonnull final Vector3d leashPoint)

Method setLeashPoint.

Parameters:
@Nonnull final Vector3d leashPoint

getLeashHeading

public float getLeashHeading ()

Method getLeashHeading.

setLeashHeading

public void setLeashHeading (final float leashHeading)

Method setLeashHeading.

Parameters:
final float leashHeading

getLeashPitch

public float getLeashPitch ()

Method getLeashPitch.

setLeashPitch

public void setLeashPitch (final float leashPitch)

Method setLeashPitch.

Parameters:
final float leashPitch

getHoverPhase

public float getHoverPhase ()

Method getHoverPhase.

setHoverPhase

public void setHoverPhase (final float hoverPhase)

Method setHoverPhase.

Parameters:
final float hoverPhase

getHoverHeight

public double getHoverHeight ()

Method getHoverHeight.

setHoverHeight

public void setHoverHeight (final double hoverHeight)

Method setHoverHeight.

Parameters:
final double hoverHeight

getRoleName

public String getRoleName ()

Method getRoleName.

setRoleName

public void setRoleName (final String roleName)

Method setRoleName.

Parameters:
final String roleName

getRoleIndex

public int getRoleIndex ()

Method getRoleIndex.

setRoleIndex

public void setRoleIndex (final int roleIndex)

Method setRoleIndex.

Parameters:
final int roleIndex

setRole

public void setRole (final Role role)

Method setRole.

Parameters:
final Role role

getSpawnRoleIndex

public int getSpawnRoleIndex ()

Method getSpawnRoleIndex.

setSpawnRoleIndex

public void setSpawnRoleIndex (int spawnRoleIndex)

Method setSpawnRoleIndex.

Parameters:
int spawnRoleIndex

getBlockTypeBlackboardView

public BlockTypeView getBlockTypeBlackboardView (@Nonnull final Ref ref, @Nonnull final Store store)

Method getBlockTypeBlackboardView.

Parameters:
@Nonnull final Ref ref
@Nonnull final Store store

removeBlockTypeBlackboardView

public BlockTypeView removeBlockTypeBlackboardView ()

Method removeBlockTypeBlackboardView.

initBlockTypeBlackboardView

public void initBlockTypeBlackboardView (@Nonnull final Ref ref, final ComponentAccessor componentAccessor)

Method initBlockTypeBlackboardView.

Parameters:
@Nonnull final Ref ref
final ComponentAccessor componentAccessor

initBlockChangeBlackboardView

public void initBlockChangeBlackboardView (@Nonnull final Ref ref, final ComponentAccessor componentAccessor)

Method initBlockChangeBlackboardView.

Parameters:
@Nonnull final Ref ref
final ComponentAccessor componentAccessor

addBlackboardBlockTypeSets

public void addBlackboardBlockTypeSets (final IntList blackboardBlockSets)

Method addBlackboardBlockTypeSets.

Parameters:
final IntList blackboardBlockSets

getBlackboardBlockTypeSets

public IntList getBlackboardBlockTypeSets ()

Method getBlackboardBlockTypeSets.

addBlackboardBlockChangeSets

public void addBlackboardBlockChangeSets (@Nonnull final BlockEventType type, @Nonnull final IntSet sets)

Method addBlackboardBlockChangeSets.

Parameters:
@Nonnull final BlockEventType type
@Nonnull final IntSet sets

getBlackboardBlockChangeSet

public IntSet getBlackboardBlockChangeSet (final BlockEventType type)

Method getBlackboardBlockChangeSet.

Parameters:
final BlockEventType type

getBlackboardBlockChangeSets

public IntSet> getBlackboardBlockChangeSets ()

Method getBlackboardBlockChangeSets.

notifyBlockChange

public void notifyBlockChange (@Nonnull final BlockEventType type, @Nonnull final EventNotification notification)

Method notifyBlockChange.

Parameters:
@Nonnull final BlockEventType type
@Nonnull final EventNotification notification

addBlackboardEntityEventSets

public void addBlackboardEntityEventSets (@Nonnull final EntityEventType type, @Nonnull final IntSet sets)

Method addBlackboardEntityEventSets.

Parameters:
@Nonnull final EntityEventType type
@Nonnull final IntSet sets

getBlackboardEntityEventSet

public IntSet getBlackboardEntityEventSet (@Nonnull final EntityEventType type)

Method getBlackboardEntityEventSet.

Parameters:
@Nonnull final EntityEventType type

getBlackboardEntityEventSets

public IntSet> getBlackboardEntityEventSets ()

Method getBlackboardEntityEventSets.

notifyEntityEvent

public void notifyEntityEvent (@Nonnull final EntityEventType type, @Nonnull final EntityEventNotification notification)

Method notifyEntityEvent.

Parameters:
@Nonnull final EntityEventType type
@Nonnull final EntityEventNotification notification

setEnvironment

public void setEnvironment (final int env)

Method setEnvironment.

Parameters:
final int env

getEnvironment

public int getEnvironment ()

Method getEnvironment.

getSpawnConfiguration

public int getSpawnConfiguration ()

Method getSpawnConfiguration.

setSpawnConfiguration

public void setSpawnConfiguration (final int spawnConfigurationIndex)

Method setSpawnConfiguration.

Parameters:
final int spawnConfigurationIndex

updateSpawnTrackingState

public boolean updateSpawnTrackingState (final boolean newState)

Method updateSpawnTrackingState.

Parameters:
final boolean newState

isDespawning

public boolean isDespawning ()

Method isDespawning.

isPlayingDespawnAnim

public boolean isPlayingDespawnAnim ()

Method isPlayingDespawnAnim.

getRoleDebugFlags

public EnumSet getRoleDebugFlags ()

Method getRoleDebugFlags.

setRoleDebugFlags

public void setRoleDebugFlags (@Nonnull final EnumSet flags)

Method setRoleDebugFlags.

Parameters:
@Nonnull final EnumSet flags

setSpawnInstant

public void setSpawnInstant (@Nonnull final Instant spawned)

Method setSpawnInstant.

Parameters:
@Nonnull final Instant spawned

getSpawnInstant

public Instant getSpawnInstant ()

Method getSpawnInstant.

setInventorySize

public void setInventorySize (final int hotbarCapacity, final int inventoryCapacity, final int offHandCapacity)

Method setInventorySize.

Parameters:
final int hotbarCapacity
final int inventoryCapacity
final int offHandCapacity

getLegacyWorldgenId

public int getLegacyWorldgenId ()

Method getLegacyWorldgenId.

getPathManager

public PathManager getPathManager ()

Method getPathManager.

setAppearance

static boolean setAppearance (@Nonnull final Ref ref, @Nonnull final String name, @Nonnull final ComponentAccessor componentAccessor)

Method setAppearance.

Parameters:
@Nonnull final Ref ref
@Nonnull final String name
@Nonnull final ComponentAccessor componentAccessor

ModelComponent

public new ModelComponent (model)

Method ModelComponent.

Parameters:
model model

getCurrentHorizontalSpeedMultiplier

public float getCurrentHorizontalSpeedMultiplier (@Nullable final Ref ref, @Nullable final ComponentAccessor componentAccessor)

Method getCurrentHorizontalSpeedMultiplier.

Parameters:
@Nullable final Ref ref
@Nullable final ComponentAccessor componentAccessor

toString

public String toString ()

Method toString.

getNPCTypeId

public String getNPCTypeId ()

Method getNPCTypeId.

getNPCTypeIndex

public int getNPCTypeIndex ()

Method getNPCTypeIndex.

addReservation

public void addReservation (@Nonnull final UUID playerUUID)

Method addReservation.

Parameters:
@Nonnull final UUID playerUUID

removeReservation

public void removeReservation (@Nonnull final UUID playerUUID)

Method removeReservation.

Parameters:
@Nonnull final UUID playerUUID

isReserved

public boolean isReserved ()

Method isReserved.

isReservedBy

public boolean isReservedBy (@Nonnull final UUID playerUUID)

Method isReservedBy.

Parameters:
@Nonnull final UUID playerUUID