Class StructureEventToggleStart
java.lang.Object
org.bukkit.event.Event
nl.pim16aap2.animatedarchitecture.spigot.core.events.AnimatedArchitectureSpigotEvent
nl.pim16aap2.animatedarchitecture.spigot.core.events.StructureEventToggleStart
- All Implemented Interfaces:
IAnimatedArchitectureEvent,IStructureEventToggleStart,IStructureToggleEvent
public class StructureEventToggleStart
extends AnimatedArchitectureSpigotEvent
implements IStructureEventToggleStart
Implementation of
IStructureEventToggleStart for the Spigot platform.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StructureActionTypeprotected final booleanprotected final StructureActionCauseprotected final IPlayerprotected final double -
Constructor Summary
ConstructorsConstructorDescriptionStructureEventToggleStart(Structure structure, StructureSnapshot snapshot, StructureActionCause cause, StructureActionType actionType, IPlayer responsible, double time, boolean skipAnimation, Cuboid newCuboid) Constructs a structure action event. -
Method Summary
Modifier and TypeMethodDescriptionGets the type of the requested action.getCause()Gets what caused the structure action request to be created.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the new coordinates of the structure after the toggle.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.Gets the structure that is the subject of this event.doublegetTime()Gets requested duration of the animation.booleanChecks if the event requested the structure to skip its animation and open instantly.toString()Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.events.IAnimatedArchitectureEvent
getEventName, isAsynchronousMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.events.IStructureToggleEvent
getActionType, getCause, getResponsible, getSnapshot, getTime, isAnimationSkipped
-
Field Details
-
cause
-
actionType
-
responsible
-
time
protected final double time -
animationSkipped
protected final boolean animationSkipped
-
-
Constructor Details
-
StructureEventToggleStart
public StructureEventToggleStart(Structure structure, StructureSnapshot snapshot, StructureActionCause cause, StructureActionType actionType, IPlayer responsible, double time, boolean skipAnimation, Cuboid newCuboid) Constructs a structure action event.- Parameters:
structure- The structure.snapshot- A snapshot of the structure created at the time the toggle action was requested.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.newCuboid- TheCuboidrepresenting the area the structure will take up after the toggle.
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers() -
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
toString
- Overrides:
toStringin classAnimatedArchitectureSpigotEvent
-
getNewCuboid
Description copied from interface:IStructureEventToggleStartGets the new coordinates of the structure after the toggle.- Specified by:
getNewCuboidin interfaceIStructureEventToggleStart- Returns:
- The new coordinates of the structure after the toggle.
-
getStructure
Description copied from interface:IStructureEventToggleStartGets the structure that is the subject of this event.Note that this structure is not the same as the structure in the snapshot. The snapshot contains the old data of the structure before the animation was applied. The structure, however, may already have been modified.
- Specified by:
getStructurein interfaceIStructureEventToggleStart- Returns:
- The structure.
-
getSnapshot
Description copied from interface:IStructureToggleEventBefore 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:
getSnapshotin interfaceIStructureToggleEvent- Returns:
- A snapshot of the structure created at the time the toggle action was requested.
-
getCause
Description copied from interface:IStructureToggleEventGets what caused the structure action request to be created.- Specified by:
getCausein interfaceIStructureToggleEvent- Returns:
- The cause of the structure action request.
-
getActionType
Description copied from interface:IStructureToggleEventGets the type of the requested action.- Specified by:
getActionTypein interfaceIStructureToggleEvent- Returns:
- The type of the requested action.
-
getResponsible
Description copied from interface:IStructureToggleEventGets 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:
getResponsiblein interfaceIStructureToggleEvent- Returns:
- The player that is responsible for this event.
-
getTime
public double getTime()Description copied from interface:IStructureToggleEventGets requested duration of the animation. This may differ from the final duration based on other factors (such as speed limits).- Specified by:
getTimein interfaceIStructureToggleEvent- Returns:
- The requested duration of the animation (in seconds).
-
isAnimationSkipped
public boolean isAnimationSkipped()Description copied from interface:IStructureToggleEventChecks if the event requested the structure to skip its animation and open instantly.- Specified by:
isAnimationSkippedin interfaceIStructureToggleEvent- Returns:
- True if the event requested the structure to skip its animation and open instantly.
-