Interface SlimeLoader
- All Known Implementing Classes:
UpdatableLoader
public interface SlimeLoader
SlimeLoaders are in charge of loading worlds
from a data source, and also locking and
deleting them.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteWorld(String worldName) Deletes a world from the data source.Returns the current saved world names.byte[]Read a world's data file.voidSaves the world's data file.booleanworldExists(String worldName) Checks whether a world exists inside the data source.
-
Method Details
-
readWorld
Read a world's data file.- Parameters:
worldName- The name of the world.- Returns:
- The world's data file, contained inside a byte array.
- Throws:
UnknownWorldException- if the world cannot be found.IOException- if the world could not be obtained.
-
worldExists
Checks whether a world exists inside the data source.- Parameters:
worldName- The name of the world.- Returns:
trueif the world exists inside the data source,falseotherwhise.- Throws:
IOException- if the world could not be obtained.
-
listWorlds
Returns the current saved world names.- Returns:
- a list containing all the world names
- Throws:
IOException- if the list could not be obtained
-
saveWorld
Saves the world's data file. This method will also lock the world, in case it's not locked already.- Parameters:
worldName- The name of the world.serializedWorld- The world's data file, contained inside a byte array.- Throws:
IOException- if the world could not be saved.
-
deleteWorld
Deletes a world from the data source.- Parameters:
worldName- name of the world- Throws:
UnknownWorldException- if the world could not be found.IOException- if the world could not be deleted.
-