Skip to content

Commit

Permalink
Added documentation for unloading a world
Browse files Browse the repository at this point in the history
  • Loading branch information
Swofty-Developments committed Nov 23, 2023
1 parent 07bbec1 commit 3775731
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .docs/api/unload-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Given that you have your SlimeWorld object, you can unload it using the following method:
```java
slimeworld.unloadWorld(true);
```
The boolean parameter indicates whether the world should be saved or not. If you want to save the world, set it to true. Otherwise, set it to false.

There is also an optional second parameter that allows you to manually set a 'fallback' world. This is the world that players will be teleported to if they are in the world that is being unloaded. If you don't set this parameter, the fallback world will be the default world.

```java
slimeworld.unloadWorld(true, "world_the_end");
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Javadocs can be found [here](https://swofty-developments.github.io/Continued-Sli
* [Loading a world](.docs/api/load-world.md)
* [Migrating a world](.docs/api/migrate-world.md)
* [Importing a world](.docs/api/import-world.md)
* [Unload a world](.docs/api/unload-world.md)
* [Using other data sources](.docs/api/use-data-source.md)
* [FAQ](.docs/faq.md)

Expand Down

0 comments on commit 3775731

Please sign in to comment.