Interface IStructureToggleEvent
- All Superinterfaces:
IAnimatedArchitectureEvent
- All Known Subinterfaces:
IStructureEventToggleEnd, IStructureEventTogglePrepare, IStructureEventToggleStart
- All Known Implementing Classes:
StructureEventToggleEnd, StructureEventTogglePrepare, StructureEventToggleStart
Represents an event where a structure is toggled.
The subclasses of this class define the different stages of the toggle event.
Preparation stages can be cancelled, while the start and end stages cannot.
-
Method Summary
Modifier and TypeMethodDescriptionGets the type of the requested action.getCause()Gets what caused the structure action request to be created.Gets the UUID of the player responsible for this structure action.Before the structure is animated, a snapshot of the data is created which is then used for all calculations.doublegetTime()Gets requested duration of the animation.booleanChecks if the event requested the structure to skip its animation and open instantly.Methods inherited from interface IAnimatedArchitectureEvent
getEventName, isAsynchronous
-
Method Details
-
getSnapshot
StructureSnapshot getSnapshot()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.
- Returns:
- A snapshot of the structure created at the time the toggle action was requested.
-
getCause
StructureActionCause getCause()Gets what caused the structure action request to be created.- Returns:
- The cause of the structure action request.
-
getResponsible
IPlayer getResponsible()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.- Returns:
- The player that is responsible for this event.
-
getActionType
StructureActionType getActionType()Gets the type of the requested action.- Returns:
- The type of the requested action.
-
isAnimationSkipped
boolean isAnimationSkipped()Checks if the event requested the structure to skip its animation and open instantly.- Returns:
- True if the event requested the structure to skip its animation and open instantly.
-
getTime
double getTime()Gets requested duration of the animation. This may differ from the final duration based on other factors (such as speed limits).- Returns:
- The requested duration of the animation (in seconds).
-