Class StructurePrepareAddOwnerEvent
java.lang.Object
org.bukkit.event.Event
nl.pim16aap2.animatedarchitecture.spigot.core.events.AnimatedArchitectureSpigotEvent
nl.pim16aap2.animatedarchitecture.spigot.core.events.StructurePrepareAddOwnerEvent
- All Implemented Interfaces:
IAnimatedArchitectureEvent,ICancellableAnimatedArchitectureEvent,IStructureEvent,IStructurePrepareAddOwnerEvent
public class StructurePrepareAddOwnerEvent
extends AnimatedArchitectureSpigotEvent
implements IStructurePrepareAddOwnerEvent
Represents the event where a new owner is added to a structure.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionThe player responsible for the event.protected final StructureThe structure that is targeted by the event. -
Constructor Summary
ConstructorsConstructorDescriptionStructurePrepareAddOwnerEvent(Structure structure, @Nullable IPlayer responsible, StructureOwner newStructureOwner) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the newStructureOwnerthat will be added to the structure.The player responsible for the event.The structure that is targeted by the event.booleanChecks if this event has been cancelled or not.voidsetCancelled(boolean isCancelled) Sets the cancelled status of this event.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, isAsynchronous
-
Field Details
-
structure
The structure that is targeted by the event. -
responsible
The player responsible for the event.If the event is caused by a player, such as a player deleting a structure, the responsible player will be set.
If the event is not caused by a player, this will be empty. This can be the case when a structure is toggled by a redstone signal.
-
-
Constructor Details
-
StructurePrepareAddOwnerEvent
public StructurePrepareAddOwnerEvent(Structure structure, @Nullable @Nullable IPlayer responsible, StructureOwner newStructureOwner)
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
toString
- Overrides:
toStringin classAnimatedArchitectureSpigotEvent
-
isCancelled
public boolean isCancelled()Description copied from interface:ICancellableAnimatedArchitectureEventChecks if this event has been cancelled or not.- Specified by:
isCancelledin interfaceICancellableAnimatedArchitectureEvent- Returns:
- True if it has been cancelled.
-
setCancelled
public void setCancelled(boolean isCancelled) Description copied from interface:ICancellableAnimatedArchitectureEventSets the cancelled status of this event.- Specified by:
setCancelledin interfaceICancellableAnimatedArchitectureEvent- Parameters:
isCancelled- True to cancel the event.
-
getNewStructureOwner
Description copied from interface:IStructurePrepareAddOwnerEventGets the newStructureOwnerthat will be added to the structure.- Specified by:
getNewStructureOwnerin interfaceIStructurePrepareAddOwnerEvent- Returns:
- The new
StructureOwner.
-
getStructure
The structure that is targeted by the event.- Specified by:
getStructurein interfaceIStructureEvent- Returns:
- The
Structurethat will be created.
-
getResponsible
The player responsible for the event.If the event is caused by a player, such as a player deleting a structure, the responsible player will be set.
If the event is not caused by a player, this will be empty. This can be the case when a structure is toggled by a redstone signal.
- Specified by:
getResponsiblein interfaceIStructureEvent- Returns:
- The player responsible for the event or empty if the event is not caused by a player.
-