Class DeployablesUtils

java.lang.Object
com.hypixel.hytale.builtin.deployables.DeployablesUtils

public class DeployablesUtils extends Object
  • Constructor Details

    • DeployablesUtils

      public DeployablesUtils()
  • Method Details

    • spawnDeployable

      @Nonnull public static Ref<EntityStore> spawnDeployable(@Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull Store<EntityStore> store, @Nonnull DeployableConfig config, @Nonnull Ref<EntityStore> deployerRef, @Nonnull org.joml.Vector3d position, @Nonnull Rotation3f rotation, @Nonnull String spawnFace)
      Called to spawn and return a deployable entity based on the provided deployable config.
      Parameters:
      commandBuffer - The CommandBuffer<EntityStore> for component access.
      store - The Store<EntityStore> for component access.
      config - The DeployableConfig instance to reference.
      deployerRef - The entity reference of the instigating entity.
      position - The position in which to spawn the deployable.
      rotation - The rotation to apply to the deployable.
      spawnFace - The provided spawn face for the deployable.
      Returns:
      the entity reference of the newly created deployable entity.
    • playAnimation

      public static void playAnimation(@Nonnull Store<EntityStore> store, int networkId, @Nonnull Ref<EntityStore> ref, @Nonnull DeployableConfig config, @Nonnull AnimationSlot animationSlot, @Nullable String itemAnimationsId, @Nonnull String animationId)
      Called to play a specific animation on the provided deployable entity
      Parameters:
      store - - Given affiliated entity store instance
      networkId - - Given network ID of the deployable entity
      ref - - Given entity reference affiliated with the deployable entity
      config - - Given affiliated DeployableConfig instance
      animationSlot - - Given animation slot to play this animation
      itemAnimationsId - - Given ID of the active animations
      animationId - - Given ID of the animation to play
    • stopAnimation

      public static void stopAnimation(@Nonnull Store<EntityStore> store, int networkId, @Nonnull Ref<EntityStore> ref, @Nonnull AnimationSlot animationSlot)
      Called to play a specific animation on the provided deployable entity
      Parameters:
      store - - Given affiliated entity store instance
      networkId - - Given network ID of the deployable entity
      ref - - Given entity reference affiliated with the deployable entity
      animationSlot - - Given animation slot to play this animation
    • playSoundEventsAtEntity

      public static void playSoundEventsAtEntity(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor, int localIndex, int worldIndex, @Nonnull org.joml.Vector3d pos)
      Called to play sound events at the given entity reference. Playing both a local and world sound if applicable.
      Parameters:
      ref - The entity reference to play the sound at.
      componentAccessor - The ComponentAccessor for component access.
      localIndex - The local sound event index.
      worldIndex - The world sound event index.
      pos - The position to play the sound at.