Package com.tomkeuper.bedwars.api.server
Class RestoreAdapter
java.lang.Object
com.tomkeuper.bedwars.api.server.RestoreAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionRestoreAdapter(org.bukkit.plugin.Plugin owner) Constructor for RestoreAdapter. -
Method Summary
Modifier and TypeMethodDescriptionvoidclearItems(@NotNull org.bukkit.World world) Clear all entities for a given worldabstract voidcloneArena(String sourceArena, String destinationArena) Clone an arena world.abstract voidConvert worlds if necessary before loading them.abstract voiddeleteWorld(String name) Delete a world.voidforeachBlockInRegion(@Nullable org.bukkit.Location corner1, @Nullable org.bukkit.Location corner2, @NotNull Consumer<org.bukkit.block.Block> consumer) abstract StringGet the display name of the restore adapter.org.bukkit.plugin.PlugingetOwner()Get the owner plugin of the adapter.Get the list of worlds.abstract booleanCheck if the given world exists.abstract voidUnload the world.abstract voidLoad the world.voidonLobbyRemoval(@NotNull IArena arena) Remove lobby blocks.abstract voidRestore the world.abstract voidonSetupSessionClose(ISetupSession setupSession) Unload the world.abstract voidonSetupSessionStart(ISetupSession setupSession) Load the world for setting it up.
-
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
Load the world. Arenas will be initialized automatically based on WorldLoadEvent.- Parameters:
arena- The arena to enable.
-
onRestart
Restore the world. Call new Arena when it's done.- Parameters:
arena- The arena to restart.
-
onDisable
Unload the world. This is usually used for /bw unloadArena name.- Parameters:
arena- The arena to disable.
-
onSetupSessionStart
Load the world for setting it up.- Parameters:
setupSession- The setup session containing the world to load.
-
onSetupSessionClose
Unload the world.- Parameters:
setupSession- The setup session containing the world to unload.
-
onLobbyRemoval
Remove lobby blocks.- Parameters:
arena- The arena to remove lobby blocks from.
-
isWorld
Check if the given world exists.- Parameters:
name- The name of the world to check.- Returns:
- `true` if the world exists, `false` otherwise.
-
deleteWorld
Delete a world.- Parameters:
name- The name of the world to delete.
-
cloneArena
Clone an arena world.- Parameters:
sourceArena- The name of the source world to clone.destinationArena- The name of the destination world to create.
-
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
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.
-