Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getComponentType()
- clone()
- tick(float, int, ArchetypeChunk, Store, CommandBuffer)
- init(Ref, Store, DeployableConfig, Instant, String)
- getOwner()
- getOwnerUUID()
- getConfig()
- getSpawnInstant()
- getTimeSinceLastAttack()
- setTimeSinceLastAttack(float)
- incrementTimeSinceLastAttack(float)
- getSpawnFace()
- getFlag(DeployableComponent.DeployableFlag)
- setFlag(DeployableComponent.DeployableFlag, int)
- getDebugColor()
Class DeployableComponent
java.lang.Object
com.hypixel.hytale.builtin.deployables.component.DeployableComponent
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
An entity component that represents a deployable entity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the type of flags that this deployable can set data for. -
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static ComponentType<EntityStore, DeployableComponent> org.joml.Vector3fReturns the debug color of this deployable entity, or assigns a new random color if one has not already ben set.intCalled to get the value of a specific flag based on the provided key.getOwner()floatfloatincrementTimeSinceLastAttack(float time) Called to increment the time in which this deployable last performed an attack.voidinit(Ref<EntityStore> deployerRef, Store<EntityStore> store, DeployableConfig config, Instant spawnInstant, String spawnFace) Called to set up this deployable entity with the provided information.voidsetFlag(DeployableComponent.DeployableFlag key, int value) Called to set the value of a specific flag based on the provided key.voidsetTimeSinceLastAttack(float time) Called to set the time in which this deployable last performed an attack.voidtick(float dt, int index, ArchetypeChunk<EntityStore> archetypeChunk, Store<EntityStore> store, CommandBuffer<EntityStore> commandBuffer) Called to tick the logic of this deployable component.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
DeployableComponent
public DeployableComponent()
-
-
Method Details
-
getComponentType
- Returns:
- the component type for the
DeployableComponentinstance.
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-
tick
public void tick(float dt, int index, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer) Called to tick the logic of this deployable component.- Parameters:
dt- The delta time of this tick.index- The index of the deployable entity.archetypeChunk- TheArchetypeChunk<EntityStore>that this entity is associated with.store- TheStore<EntityStore>for component access.commandBuffer- TheCommandBuffer<EntityStore>for component access.
-
init
public void init(@Nonnull Ref<EntityStore> deployerRef, @Nonnull Store<EntityStore> store, @Nonnull DeployableConfig config, @Nonnull Instant spawnInstant, @Nonnull String spawnFace) Called to set up this deployable entity with the provided information.- Parameters:
deployerRef- The entity reference of the instigating entity.store- TheStore<EntityStore>for component access.config- TheDeployableConfiginstance to associated with this entity.spawnInstant- The time in which the deployable was spawned.spawnFace- The spawn face of the deployable entity.
-
getOwner
- Returns:
- the entity reference of the owner of this deployable.
-
getOwnerUUID
-
getConfig
- Returns:
DeployableConfigthat is associated with this deployable.
-
getSpawnInstant
- Returns:
- the time in which this deployable was spawned.
-
getTimeSinceLastAttack
public float getTimeSinceLastAttack()- Returns:
- the time in which this deployable last performed an attack.
-
setTimeSinceLastAttack
public void setTimeSinceLastAttack(float time) Called to set the time in which this deployable last performed an attack.- Parameters:
time- The time to set.
-
incrementTimeSinceLastAttack
public float incrementTimeSinceLastAttack(float time) Called to increment the time in which this deployable last performed an attack.- Parameters:
time- The given time to increment the time by.- Returns:
- the newly incremented time value.
-
getSpawnFace
- Returns:
- the spawn face of this deployable.
-
getFlag
Called to get the value of a specific flag based on the provided key.- Parameters:
key- The provided key to fetch a value for.- Returns:
- the value for the flag of the provided key.
-
setFlag
Called to set the value of a specific flag based on the provided key.- Parameters:
key- The provided key to set a value for.value- The value to set for the flag.
-
getDebugColor
@Nonnull public org.joml.Vector3f getDebugColor()Returns the debug color of this deployable entity, or assigns a new random color if one has not already ben set.- Returns:
- the debug color of this deployable.
-