Class MigrationProcessRunEvent

java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.MigrationProcessRunEvent
All Implemented Interfaces:
Cancellable

public class MigrationProcessRunEvent extends Event implements Cancellable
Gets called when a process of migration has been started using MigrationProcess.run().
  • Constructor Details

    • MigrationProcessRunEvent

      public MigrationProcessRunEvent(MigrationProcess process)
  • Method Details

    • getProcess

      public MigrationProcess getProcess()
      Returns the process that has started.
      Returns:
      The process behind all of this
    • addHaltLatch

      public void addHaltLatch(CountDownLatch latch)
      Adds a latch which can prevent the migration from proceeding.

      The process will wait until all latches have been counted down to 0 before it continues. This is used for i.a. player data modification, where we wait for other servers to unload their players.

      Parameters:
      latch - The latch to add
    • getHaltLatches

      public Collection<CountDownLatch> getHaltLatches()
      Returns an unmodifiable collection of all latches that have been added to halt the migration process.
      Returns:
      All latches that can halt the migration process
    • setCancelled

      public void setCancelled(boolean bool)
      Specified by:
      setCancelled in interface Cancellable
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()