Class StructureEventToggleEnd

java.lang.Object
org.bukkit.event.Event
nl.pim16aap2.animatedarchitecture.spigot.core.events.AnimatedArchitectureSpigotEvent
nl.pim16aap2.animatedarchitecture.spigot.core.events.StructureEventToggleEnd
All Implemented Interfaces:
IAnimatedArchitectureEvent, IStructureEventToggleEnd, IStructureToggleEvent

public class StructureEventToggleEnd extends AnimatedArchitectureSpigotEvent implements IStructureEventToggleEnd
Implementation of IStructureEventToggleEnd for the Spigot platform.
  • Field Details

    • cause

      protected final StructureActionCause cause
    • actionType

      protected final StructureActionType actionType
    • responsible

      protected final IPlayer responsible
    • time

      protected final double time
    • animationSkipped

      protected final boolean animationSkipped
  • Constructor Details

    • StructureEventToggleEnd

      public StructureEventToggleEnd(Structure structure, StructureSnapshot snapshot, StructureActionCause cause, StructureActionType actionType, IPlayer responsible, double time, boolean skipAnimation)
      Constructs a structure action event.
      Parameters:
      structure - The structure.
      cause - What caused the action.
      actionType - The type of action.
      responsible - Who is responsible for this structure. This player may be online, but does not have to be.
      time - The number of seconds the structure will take to open. Note that there are other factors that affect the total time as well.
      skipAnimation - If true, the structure will skip the animation and open instantly.
  • Method Details

    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • toString

      public String toString()
      Overrides:
      toString in class AnimatedArchitectureSpigotEvent
    • getStructure

      public Structure getStructure()
      Description copied from interface: IStructureEventToggleEnd
      Gets the structure that is the subject of this event.
      Specified by:
      getStructure in interface IStructureEventToggleEnd
      Returns:
      The structure.
    • getSnapshot

      public StructureSnapshot getSnapshot()
      Description copied from interface: IStructureToggleEvent
      Before the structure is animated, a snapshot of the data is created which is then used for all calculations.

      The snapshots are read-only, so this snapshot contains the old data of the structure before the animation was applied.

      Specified by:
      getSnapshot in interface IStructureToggleEvent
      Returns:
      A snapshot of the structure created at the time the toggle action was requested.
    • getCause

      public StructureActionCause getCause()
      Description copied from interface: IStructureToggleEvent
      Gets what caused the structure action request to be created.
      Specified by:
      getCause in interface IStructureToggleEvent
      Returns:
      The cause of the structure action request.
    • getActionType

      public StructureActionType getActionType()
      Description copied from interface: IStructureToggleEvent
      Gets the type of the requested action.
      Specified by:
      getActionType in interface IStructureToggleEvent
      Returns:
      The type of the requested action.
    • getResponsible

      public IPlayer getResponsible()
      Description copied from interface: IStructureToggleEvent
      Gets the UUID of the player responsible for this structure action. This either means the player who directly requested this action or, if it was requested indirectly (e.g. via redstone), the prime owner of the structure. Therefore, this player might not be online.
      Specified by:
      getResponsible in interface IStructureToggleEvent
      Returns:
      The player that is responsible for this event.
    • getTime

      public double getTime()
      Description copied from interface: IStructureToggleEvent
      Gets requested duration of the animation. This may differ from the final duration based on other factors (such as speed limits).
      Specified by:
      getTime in interface IStructureToggleEvent
      Returns:
      The requested duration of the animation (in seconds).
    • isAnimationSkipped

      public boolean isAnimationSkipped()
      Description copied from interface: IStructureToggleEvent
      Checks if the event requested the structure to skip its animation and open instantly.
      Specified by:
      isAnimationSkipped in interface IStructureToggleEvent
      Returns:
      True if the event requested the structure to skip its animation and open instantly.