Class DeployableComponent

java.lang.Object
com.hypixel.hytale.builtin.deployables.component.DeployableComponent
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class DeployableComponent extends Object implements Component<EntityStore>
An entity component that represents a deployable entity.
  • Constructor Details

    • DeployableComponent

      public DeployableComponent()
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, DeployableComponent> getComponentType()
      Returns:
      the component type for the DeployableComponent instance.
    • clone

      public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<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 - The ArchetypeChunk<EntityStore> that this entity is associated with.
      store - The Store<EntityStore> for component access.
      commandBuffer - The CommandBuffer<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 - The Store<EntityStore> for component access.
      config - The DeployableConfig instance to associated with this entity.
      spawnInstant - The time in which the deployable was spawned.
      spawnFace - The spawn face of the deployable entity.
    • getOwner

      public Ref<EntityStore> getOwner()
      Returns:
      the entity reference of the owner of this deployable.
    • getOwnerUUID

      public UUID getOwnerUUID()
      Returns:
      the UUID instance of the owner of this deployable.
    • getConfig

      public DeployableConfig getConfig()
      Returns:
      DeployableConfig that is associated with this deployable.
    • getSpawnInstant

      public Instant 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

      public String getSpawnFace()
      Returns:
      the spawn face of this deployable.
    • getFlag

      public int getFlag(@Nonnull DeployableComponent.DeployableFlag key)
      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

      public void setFlag(@Nonnull DeployableComponent.DeployableFlag key, int value)
      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.