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 Summary
Modifier and TypeMethodDescriptionvoidexecuteAnimationStep(IAnimator animator, Iterable<IAnimatedBlock> animatedBlocks, int ticks) Runs a single step of the animation.default @Nullable Consumer<IAnimatedBlockData> Provides the consumer that applies the rotation to theIAnimatedBlockData.getFinalPosition(int xAxis, int yAxis, int zAxis) Calculates the final position from the original coordinates of the block that will be animated.default floatgetRadius(int xAxis, int yAxis, int zAxis) Gets the radius of a block at the given coordinates.default RotatedPositiongetStartPosition(int xAxis, int yAxis, int zAxis) Calculates the starting position from the original coordinates of the block that will be animated.default voidprepareAnimation(IAnimator animator) Runs some optional steps before the animation is started.
-
Method Details
-
getFinalPosition
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
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
Provides the consumer that applies the rotation to theIAnimatedBlockData.When set to null (the default value), it does not do anything.
- Returns:
- The rotation function for the animated block data.
-
prepareAnimation
Runs some optional steps before the animation is started.- Parameters:
animator- The animator responsible for the animation.
-
executeAnimationStep
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.
-