Class BeamComponent

java.lang.Object
com.hypixel.hytale.builtin.beam.BeamComponent
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class BeamComponent extends Object implements Component<EntityStore>
Gives an entity beams that its viewers render. The beams are runtime state, so they are never saved with the entity.
See Also:
  • Field Details

  • Constructor Details

    • BeamComponent

      public BeamComponent()
    • BeamComponent

      public BeamComponent(@Nonnull AttachedBeam... beams)
    • BeamComponent

      public BeamComponent(@Nonnull BeamComponent other)
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, BeamComponent> getComponentType()
    • spawn

      @Nonnull public static Ref<EntityStore> spawn(@Nonnull Store<EntityStore> store, @Nonnull org.joml.Vector3d position, @Nonnull AttachedBeam... beams)
      Spawns an entity that has beams but no model, and keeps it until something removes it.
      Parameters:
      position - the position the entity is tracked at, which decides who can see the beams
    • spawn

      @Nonnull public static Ref<EntityStore> spawn(@Nonnull Store<EntityStore> store, @Nonnull org.joml.Vector3d position, float lifetime, @Nonnull AttachedBeam... beams)
      Spawns an entity that has beams but no model, for beams that do not belong to anything else. The entity is replicated so viewers can render its beams, and it is never saved.
      Parameters:
      position - the position the entity is tracked at, which decides who can see the beams
      lifetime - how long the entity lives for, in seconds, or NO_LIFETIME to keep it until something removes it
    • getBeams

      @Nonnull public List<AttachedBeam> getBeams()
      Returns a read-only view of the beams of this entity. Change them through this component so viewers are told about the change.
    • add

      public void add(@Nonnull AttachedBeam beam)
    • remove

      public boolean remove(@Nonnull AttachedBeam beam)
    • set

      public void set(@Nonnull List<AttachedBeam> newBeams)
    • clear

      public void clear()
    • isEmpty

      public boolean isEmpty()
    • removeInvalid

      public void removeInvalid()
      Drops the beams whose target entity is gone.
    • consumeNetworkOutdated

      public boolean consumeNetworkOutdated()
      Returns whether the beams changed since the last call, and clears the change.
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.

    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object