Class RestoreAdapter

java.lang.Object
com.tomkeuper.bedwars.api.server.RestoreAdapter

public abstract class RestoreAdapter extends Object
  • Constructor Details

    • RestoreAdapter

      public RestoreAdapter(org.bukkit.plugin.Plugin owner)
      Constructor for RestoreAdapter.
      Parameters:
      owner - The owner plugin of the adapter.
  • Method Details

    • getOwner

      public org.bukkit.plugin.Plugin getOwner()
      Get the owner plugin of the adapter.
      Returns:
      The owner plugin.
    • onEnable

      public abstract void onEnable(IArena arena)
      Load the world. Arenas will be initialized automatically based on WorldLoadEvent.
      Parameters:
      arena - The arena to enable.
    • onRestart

      public abstract void onRestart(IArena arena)
      Restore the world. Call new Arena when it's done.
      Parameters:
      arena - The arena to restart.
    • onDisable

      public abstract void onDisable(IArena arena)
      Unload the world. This is usually used for /bw unloadArena name.
      Parameters:
      arena - The arena to disable.
    • onSetupSessionStart

      public abstract void onSetupSessionStart(ISetupSession setupSession)
      Load the world for setting it up.
      Parameters:
      setupSession - The setup session containing the world to load.
    • onSetupSessionClose

      public abstract void onSetupSessionClose(ISetupSession setupSession)
      Unload the world.
      Parameters:
      setupSession - The setup session containing the world to unload.
    • onLobbyRemoval

      public void onLobbyRemoval(@NotNull @NotNull IArena arena)
      Remove lobby blocks.
      Parameters:
      arena - The arena to remove lobby blocks from.
    • isWorld

      public abstract boolean isWorld(String name)
      Check if the given world exists.
      Parameters:
      name - The name of the world to check.
      Returns:
      `true` if the world exists, `false` otherwise.
    • deleteWorld

      public abstract void deleteWorld(String name)
      Delete a world.
      Parameters:
      name - The name of the world to delete.
    • cloneArena

      public abstract void cloneArena(String sourceArena, String destinationArena)
      Clone an arena world.
      Parameters:
      sourceArena - The name of the source world to clone.
      destinationArena - The name of the destination world to create.
    • getWorldsList

      public abstract List<String> getWorldsList()
      Get the list of worlds.
      Returns:
      The list of world names.
    • convertWorlds

      public abstract void convertWorlds()
      Convert worlds if necessary before loading them. Let them load on BedWars2023 main Thread, so they will be converted before getting loaded.
    • getDisplayName

      public abstract String getDisplayName()
      Get the display name of the restore adapter.
      Returns:
      The display name.
    • foreachBlockInRegion

      public void foreachBlockInRegion(@Nullable @Nullable org.bukkit.Location corner1, @Nullable @Nullable org.bukkit.Location corner2, @NotNull @NotNull Consumer<org.bukkit.block.Block> consumer)
    • clearItems

      public void clearItems(@NotNull @NotNull org.bukkit.World world)
      Clear all entities for a given world
      Parameters:
      world - The world instance.