java.lang.Object
nl.pim16aap2.animatedarchitecture.core.animation.Animation<T>
Type Parameters:
T - The type of the animated block.

public class Animation<T extends IAnimatedBlock> extends Object
Represents an animation.
  • Method Details

    • getRemainingSteps

      public int getRemainingSteps()
      Returns:
      The number of animation steps remaining in this animation. This only includes the steps to be executed by the animation and not any steps required for the cleanup phase.

      When isPerpetual() is true, this method always returns getDuration().

    • getDuration

      public int getDuration()
      The number of animation steps that this animation will execute. This excludes any steps taken during the cleanup phase.
    • isPerpetual

      public boolean isPerpetual()
      True if the animation is 'perpetual'.

      Perpetual animations will continue until aborted externally. This may happen when the area they are animating in is unloaded by the server, when the server/plugin restarts, or when a user stops/deletes the structure.

    • getRegion

      public Cuboid getRegion()
      The region that this animation currently occupies.

      It should be noted that this is only a rather inaccurate approximation, as it is a snapshot of the region of a moving object. Additionally, there are further inaccuracies introduced by rounding and region buffering.

    • getAnimatedBlocks

      public List<T> getAnimatedBlocks()
      The list of animated blocks that are used in this animation.
    • getStructureSnapshot

      public StructureSnapshot getStructureSnapshot()
      A snapshot of the structure being animated, created before the movement started.
    • getStructureType

      public StructureType getStructureType()
      The type of the structure being toggled.
    • getState

      public Animation.AnimationState getState()
      The current state of the animation.
    • getStepsExecuted

      public int getStepsExecuted()
      The number of animation steps that have been executed so far during this animation. This excludes any steps taken during the cleanup phase.
    • getAnimationType

      public AnimationType getAnimationType()
      The type of the animation.
    • getResponsible

      public IPlayer getResponsible()
      The player responsible for the animation.

      This player may be the player who requested the animation, or it may be the prime owner of the structure if the animation request was not made by a player.

      This player may not be online.