Class StructurePrepareCreateEvent

java.lang.Object
org.bukkit.event.Event
nl.pim16aap2.animatedarchitecture.spigot.core.events.AnimatedArchitectureSpigotEvent
nl.pim16aap2.animatedarchitecture.spigot.core.events.StructurePrepareCreateEvent
All Implemented Interfaces:
IAnimatedArchitectureEvent, ICancellableAnimatedArchitectureEvent, IStructureEvent, IStructurePrepareCreateEvent

public class StructurePrepareCreateEvent extends AnimatedArchitectureSpigotEvent implements IStructurePrepareCreateEvent
Represents the event where a structure will be created.
  • Field Details

    • structure

      protected final Structure structure
      The structure that is targeted by the event.
    • responsible

      protected final Optional<IPlayer> 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

    • StructurePrepareCreateEvent

      public StructurePrepareCreateEvent(Structure structure, @Nullable @Nullable IPlayer responsible)
  • Method Details

    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

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

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

      public boolean isCancelled()
      Description copied from interface: ICancellableAnimatedArchitectureEvent
      Checks if this event has been cancelled or not.
      Specified by:
      isCancelled in interface ICancellableAnimatedArchitectureEvent
      Returns:
      True if it has been cancelled.
    • setCancelled

      public void setCancelled(boolean isCancelled)
      Description copied from interface: ICancellableAnimatedArchitectureEvent
      Sets the cancelled status of this event.
      Specified by:
      setCancelled in interface ICancellableAnimatedArchitectureEvent
      Parameters:
      isCancelled - True to cancel the event.
    • getStructure

      public Structure getStructure()
      The structure that is targeted by the event.
      Specified by:
      getStructure in interface IStructureEvent
      Returns:
      The Structure that will be created.
    • getResponsible

      public Optional<IPlayer> 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:
      getResponsible in interface IStructureEvent
      Returns:
      The player responsible for the event or empty if the event is not caused by a player.