Interface IAnimationComponent

All Known Implementing Classes:
BigDoorAnimationComponent, ClockAnimationComponent, CounterWeightGarageDoorAnimationComponent, DrawbridgeAnimationComponent, FlagAnimationComponent, RevolvingDoorAnimationComponent, SectionalGarageDoorAnimationComponent, SlidingDoorAnimationComponent, VerticalAnimationComponent, WindmillAnimationComponent

public interface IAnimationComponent
Represents a component of an animation.
  • Method Details

    • getFinalPosition

      RotatedPosition getFinalPosition(int xAxis, int yAxis, int zAxis)
      Calculates the final position from the original coordinates of the block that will be animated.
      Parameters:
      xAxis - The x-coordinate of the original location of the block.
      yAxis - The y-coordinate of the original location of the block.
      zAxis - The z-coordinate of the original location of the block.
      Returns:
      The final position of an IAnimatedBlock.
    • getStartPosition

      default RotatedPosition getStartPosition(int xAxis, int yAxis, int zAxis)
      Calculates the starting position from the original coordinates of the block that will be animated.
      Parameters:
      xAxis - The x-coordinate of the original location of the block.
      yAxis - The y-coordinate of the original location of the block.
      zAxis - The z-coordinate of the original location of the block.
      Returns:
      The starting position of an IAnimatedBlock.
    • getBlockDataRotator

      @Nullable default @Nullable Consumer<IAnimatedBlockData> getBlockDataRotator()
      Provides the consumer that applies the rotation to the IAnimatedBlockData.

      When set to null (the default value), it does not do anything.

      Returns:
      The rotation function for the animated block data.
    • prepareAnimation

      default void prepareAnimation(IAnimator animator)
      Runs some optional steps before the animation is started.
      Parameters:
      animator - The animator responsible for the animation.
    • executeAnimationStep

      void executeAnimationStep(IAnimator animator, Iterable<IAnimatedBlock> animatedBlocks, int ticks)
      Runs a single step of the animation.
      Parameters:
      animator - The animator responsible for the animation.
      animatedBlocks - The animated blocks for which to execute the animation step.
      ticks - The number of ticks that have passed since the start of the animation.
    • getRadius

      default float getRadius(int xAxis, int yAxis, int zAxis)
      Gets the radius of a block at the given coordinates.
      Parameters:
      xAxis - The x coordinate.
      yAxis - The y coordinate.
      zAxis - The z coordinate.
      Returns:
      The radius of a block at the given coordinates.