Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Wiki & small text errors #149

Merged
merged 3 commits into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .docs/api/custom-build-preparation.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## How can I build a custom build?

In short, (A)SWM requires the necessary spigot files in your local Maven repository. The easiest way to do this is to use Spigot's build tools [[Link](https://www.spigotmc.org/wiki/buildtools/)]. You can find all the information you need in the Wiki.
In short, ASWM requires the necessary Spigot files in your local Maven repository. The easiest way to do this is to use [Spigot's build tools](https://www.spigotmc.org/wiki/buildtools/). You can find all the information you need in the Wiki.

Summary from the Wiki:
- Download and install Git [[Link](https://git-scm.com/downloads)]
- Download and install Java 8 (AdoptOpenJDK works) [[Link](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot)]
- Download the BuildTools.jar [[Link](https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar)]
- Open a terminal or shell (the GIT shell also works) and navigate to the file BuildTools.jar
- Build the following glasses, they will automatically be added to your local Maven repo
- `java -jar BuildTools.jar --rev 1.16.3`
- `java -jar BuildTools.jar --rev 1.16.2`
- `java -jar BuildTools.jar --rev 1.16.1`
- Make changes to the (A)SWM and compile it into Maven using `package'.
- Download and install [Git](http://msysgit.github.io/)
- Download and install [Java 17](https://adoptium.net/temurin/releases?version=17) (AdoptOpenJDK works)
- Download the [BuildTools.jar](https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar)
- Open a terminal or shell (the Git shell also works) and navigate to the file **BuildTools.jar**
- Build the following classes, they will automatically be added to your local Maven repo
- `java -jar BuildTools.jar --rev 1.19.2`
- `java -jar BuildTools.jar --rev 1.19.1`
- `java -jar BuildTools.jar --rev 1.19`
- `java -jar BuildTools.jar --rev 1.18.2`
- Make changes to ASWM and compile it into Maven using `package`
10 changes: 6 additions & 4 deletions .docs/api/import-world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Importing Worlds

You need three things to import a world: a world folder, a world name and a data source. Here's an example of how to import a world:
```java
SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
Expand All @@ -7,9 +9,9 @@ String worldName = "my_world";
SlimeLoader loader = plugin.getLoader("mysql");

try {
// Note that this method should be called asynchronously
// note that this method should be called asynchronously
plugin.importWorld(worldDir, worldName, loader);
} catch (WorldAlreadyExistsException | InvalidWorldException | WorldLoadedException | WorldTooBigException | IOException ex) {
/* Exception handling */
} catch (WorldAlreadyExistsException | InvalidWorldException | WorldLoadedException | WorldTooBigException | IOException exception) {
// exception handling
}
```
```
12 changes: 7 additions & 5 deletions .docs/api/load-world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Loading Worlds

First, retrieve the SlimeWorldManager plugin API:
```java
SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
Expand All @@ -7,17 +9,17 @@ Now, you need a loader. A SlimeLoader is a class that reads and stores worlds fr
SlimeLoader sqlLoader = plugin.getLoader("mysql");
```

Before actually loading the world, you need a SlimePropertyMap Object. Check the [property api documentation](properties.md) for further details.
Before actually loading the world, you need a SlimePropertyMap Object. Check the [property API documentation](properties.md) for further details.

That's it, you've got everything you need! Now, let's load the world from the data source and generate it:
```java
try {
// Note that this method should be called asynchronously
// note that this method should be called asynchronously
SlimeWorld world = plugin.loadWorld(sqlLoader, "my-world", props);

// This method must be called synchronously
// note that this method must be called synchronously
plugin.generateWorld(world);
} catch (UnknownWorldException | IOException | CorruptedWorldException | NewerFormatException | WorldInUseException | UnsupportedWorldException ex) {
/* Exception handling */
} catch (UnknownWorldException | IOException | CorruptedWorldException | NewerFormatException | WorldInUseException | UnsupportedWorldException exception) {
// exception handling
}
```
10 changes: 5 additions & 5 deletions .docs/api/migrate-world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Migrating Worlds

To migrate a world you need three things: a world name, the data source where the world is currently stored in and another data source to store the world. Here's an example of a world migration:
```java
SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
Expand All @@ -7,11 +9,9 @@ SlimeLoader currentLoader = plugin.getLoader("mysql");
SlimeLoader newLoader = plugin.getLoader("mongodb");

try {
// Note that this method should be called asynchronously
// note that this method should be called asynchronously
plugin.migrateWorld(worldName, currentLoader, newLoader);
} catch (IOException | WorldInUseException | WorldAlreadyExistsException | UnknownWorldException ex) {
/* Exception handling */
} catch (IOException | WorldInUseException | WorldAlreadyExistsException | UnknownWorldException exception) {
// exception handling
}
```

That's it!
5 changes: 2 additions & 3 deletions .docs/api/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ Property "types" are handled by [SlimeProperty][1] instances. Whilst creating [S

**Example Usage:**
```java
// Create a new and empty property map
// create a new and empty property map
SlimePropertyMap properties = new SlimePropertyMap();

properties.setString(SlimeProperties.DIFFICULTY, "normal");
properties.setInt(SlimeProperties.SPAWN_X, 123);
properties.setInt(SlimeProperties.SPAWN_Y, 112);
properties.setInt(SlimeProperties.SPAWN_Z, 170);
/* Add as many as you like */
// add as many as you would like
```


[1]: ../../slimeworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperty.java
[2]: ../../slimeworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperties.java
[3]: ../../slimeworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimePropertyMap.java
46 changes: 33 additions & 13 deletions .docs/api/setup-dev.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
### Building
# Development Setup

To build SWM, execute the following command int the project root:
## Building the Plugin

To build ASWM, execute the following command in the project root:

```
mvn clean install
gradle clean shadowJar
```

## Using the API

If your plugin wants to use Slime World Manager add the following in your pom.xml

### Maven
If your plugin wants to use Advanced Slime World Manager add the following in your plugin:

### Maven
```xml
<repository>
<id>swm-repo</id>
<url>https://repo.glaremasters.me/repository/concuncan/</url>
</repository>
<repositories>
<repository>
<id>rapture-snapshots</id>
<url>https://repo.rapture.pw/repository/maven-snapshots/</url>
</repository>
</repositories>
```

```xml
<dependency>
<dependencies>
<dependency>
<groupId>com.grinderwolf</groupId>
<artifactId>slimeworldmanager-api</artifactId>
<version>(insert latest version here)</version>
<version>INSERT LATEST VERSION HERE</version>
<scope>provided</scope>
</dependency>
```
</dependency>
</dependencies>
```

### Gradle
```groovy
repositories {
maven { url = 'https://repo.rapture.pw/repository/maven-snapshots/' }
}

dependencies {
compileOnly 'com.grinderwolf:slimeworldmanager-api:INSERT LATEST VERSION HERE'
}
```

**If you run into any Flow-NBT errors when building your project, add the additional repository: `https://repo.rapture.pw/repository/maven-releases/`**
8 changes: 5 additions & 3 deletions .docs/api/use-data-source.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Slime World Manager supports three data sources out of the box: the filesystem, MySQL and MongoDB. However, there are situations where you might want to use other data sources. To do so, you can create your own implementation of the SlimeLoader interface.
## Custom Data Sources

SlimeLoaders are classes used to load worlds from specific data sources. Remember to check out the [docs](https://grinderwolf.github.io/Slime-World-Manager/apidocs/) for the SlimeLoader interface prior to creating your own implementation, as it contains information on what every method should exactly do. You can also take a look at the [FileLoader class](../../slimeworldmanager-plugin/src/main/java/com/grinderwolf/swm/plugin/loaders/FileLoader.java) for an example of a SlimeLoader.
Advanced Slime World Manager supports three data sources out of the box: the file system, MySQL and MongoDB. However, there are situations where you might want to use other data sources. To do so, you can create your own implementation of the SlimeLoader interface.

SlimeLoaders are classes used to load worlds from specific data sources. Remember to check out the [docs](https://grinderwolf.github.io/Slime-World-Manager/apidocs/) for the SlimeLoader interface prior to creating your own implementation, as it contains information on what every method should exactly do. You can also take a look at the [FileLoader class](../../slimeworldmanager-plugin/src/main/java/com/grinderwolf/swm/plugin/loaders/file/FileLoader.java) for an example of a SlimeLoader.

Once you've got your own SlimeLoader, remember to register it so you can use it later:
```java
SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");

plugin.registerLoader("my_data_source", new MyCustomSlimeLoader());
```
```
4 changes: 3 additions & 1 deletion .docs/config/configure-world.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
To configure a world, open the 'worlds.yml' file inside the SWM config folder. Here is an example of a worlds.yml file:
# World Configuration

To configure a world, open the 'worlds.yml' file inside the ASWM config folder. Here is an example of a worlds.yml file:
```yaml
worlds:
my_great_world:
Expand Down
14 changes: 7 additions & 7 deletions .docs/config/convert-world-to-srf.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
To be able to load a world with SWM, you have to convert it to the SRF. There are two ways of doing this:
# Converting Worlds

To be able to load a world with ASWM, you have to convert it to the SRF. There are two ways of doing this:

## Using the in-game command

Expand Down Expand Up @@ -34,17 +36,15 @@ The importer tool provides some command line arguments to configure the behavior

### Usage as API

The importer tool may be used as a dependency in your projects to import worlds programatically.
The importer tool may be used as a dependency in your projects to import worlds programmatically.

The basic usage of the API is as follows:
```java
File theOutputFile = SWMImporter.getDestinationFile(theWorldDir);

try {
SWMImporter.importWorld(theWorldDir, theOutputFile, true);
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidWorldException e) {
e.printStackTrace();
} catch (IOException | InvalidWorldException exception) {
// exception handling
}
```
```
7 changes: 5 additions & 2 deletions .docs/config/setup-data-sources.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## Data Source Configuration

Before using MySQL or MongoDB to store your worlds, you've got to configure them. To do so, navigate to the SWM config folder located inside your plugins directory, and open the 'sources.yml' file. Inside there are all the parameters you need to set. Here's an example of how your sources.yml should look like:

```yaml
file:
path: slime_worlds # The path to the directory where slime worlds are stored
# The path to the directory where slime worlds are stored
path: slime_worlds
mysql:
enabled: true
host: 127.0.0.1
Expand All @@ -21,4 +24,4 @@ mongodb:
collection: worlds
```

**Remember to enable MySQL and/or MongoDB if you are going to use them!**
**Remember to enable MySQL and/or MongoDB if you are going to use them!**
28 changes: 0 additions & 28 deletions .docs/faq.md

This file was deleted.

27 changes: 27 additions & 0 deletions .docs/other/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## FAQ

### Which Spigot versions is this compatible with?

Currently, ASWM can run on any Spigot version from 1.18.2 up to 1.19.2. If you are running on an outdated version, use [SWM](https://www.spigotmc.org/resources/slimeworldmanager.69974/).

### Can I override the default world?

Yes, you can! However, it does not work on versions 1.19+.

### My server stops when booting up with a 'Failed to find ClassModifier classes' error.

Go to [Installing Slime World Manager](../usage/install.md) and follow the steps described there.

### I'm getting a `javassist.CannotCompileException: [source error] acceptConnections() not found in net.minecraft.server.v1_14_R1.ServerConnection` error on startup.

You are running an outdated spigot version. Please update to the latest version. If this keeps happening after updating, open an issue.

### Is ASWM compatible with Multiverse-Core?

Multiverse-Core detects ASWM worlds as unloaded, as it cannot find the world directory, and then just ignores them. There should not be any issues; however, Multiverse-Core commands will not work with ASWM worlds.

### What's the world size limit?

The Slime Region Format can handle up a 46340x4630 chunk area. That's the maximum size that SWM can _theoretically_ handle, given enough memory. However, having a world so big is not recommended at all.

There's not a specific value that you shouldn't exceed _- except for the theoretical limit, of course_. ASWM keeps a copy of all the chunks loaded in memory until the world is unloaded, so the more chunks you have, the bigger the ram usage is. How far you want to go depends on how much ram you are willing to let ASWM use. Moreover, the ram usage per chunk isn't a constant value, as it depends on the actual data stored in the chunk.
Loading