Package com.infernalsuite.aswm.api.world
Interface SlimeWorld
public interface SlimeWorld
In-memory representation of a SRF world.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of the world with the given name.clone
(String worldName, SlimeLoader loader) Returns a clone of the world with the given name.default SlimeWorld
clone
(String worldName, SlimeLoader loader, boolean lock) Deprecated, for removal: This API element is subject to removal in a future version.getChunk
(int x, int z) Returns the chunk that belongs to the coordinates specified.default Map<Long,
SlimeChunk> Deprecated, for removal: This API element is subject to removal in a future version.int
com.flowpowered.nbt.CompoundTag
Returns the extra data of the world.Returns theSlimeLoader
used to load and store the world.getName()
Returns the name of the world.Returns the property map.Collection<com.flowpowered.nbt.CompoundTag>
Returns aCollection
with every world map, serialized in aCompoundTag
object.default boolean
isLocked()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
Returns whether or not read-only is enabled.
-
Method Details
-
getName
String getName()Returns the name of the world.- Returns:
- The name of the world.
-
getLoader
SlimeLoader getLoader()Returns theSlimeLoader
used to load and store the world.- Returns:
- The
SlimeLoader
used to load and store the world.
-
getChunk
Returns the chunk that belongs to the coordinates specified.- Parameters:
x
- X coordinate.z
- Z coordinate.- Returns:
- The
SlimeChunk
that belongs to those coordinates.
-
getChunkStorage
Collection<SlimeChunk> getChunkStorage() -
getChunks
Deprecated, for removal: This API element is subject to removal in a future version. -
getExtraData
com.flowpowered.nbt.CompoundTag getExtraData()Returns the extra data of the world. Inside thisCompoundTag
can be stored any information to then be retrieved later, as it's saved alongside the world data.- Returns:
- A
CompoundTag
containing the extra data of the world.
-
getWorldMaps
Collection<com.flowpowered.nbt.CompoundTag> getWorldMaps()Returns aCollection
with every world map, serialized in aCompoundTag
object.- Returns:
- A
Collection
containing every world map.
-
getPropertyMap
SlimePropertyMap getPropertyMap()Returns the property map.- Returns:
- A
SlimePropertyMap
object containing all the properties of the world.
-
isReadOnly
boolean isReadOnly()Returns whether or not read-only is enabled.- Returns:
- true if read-only is enabled, false otherwise.
-
clone
Returns a clone of the world with the given name. This world will never be stored, as thereadOnly
property will be set to true.- Parameters:
worldName
- The name of the cloned world.- Returns:
- The clone of the world.
- Throws:
IllegalArgumentException
- if the name of the world is the same as the current one or isnull
.
-
clone
SlimeWorld clone(String worldName, SlimeLoader loader) throws WorldAlreadyExistsException, IOException Returns a clone of the world with the given name. The world will be automatically stored inside the provided data source.- Parameters:
worldName
- The name of the cloned world.loader
- TheSlimeLoader
used to store the world ornull
if the world is temporary.- Returns:
- The clone of the world.
- Throws:
IllegalArgumentException
- if the name of the world is the same as the current one or isnull
.WorldAlreadyExistsException
- if there's already a world with the same name inside the provided data source.IOException
- if the world could not be stored.
-
clone
@Deprecated(forRemoval=true) default SlimeWorld clone(String worldName, SlimeLoader loader, boolean lock) throws WorldAlreadyExistsException, IOException Deprecated, for removal: This API element is subject to removal in a future version. -
isLocked
Deprecated, for removal: This API element is subject to removal in a future version.Returns whether or not this world is locked and, therefore, can be loaded on the server by using theSlimePlugin.loadWorld(SlimeWorld)
method.- Returns:
- true if the world is locked, false otherwise
-
getDataVersion
int getDataVersion()
-