Package com.infernalsuite.asp.api.world
Interface SlimeWorld
- All Superinterfaces:
 org.bukkit.persistence.PersistentDataHolder,io.papermc.paper.persistence.PersistentDataViewHolder
- All Known Subinterfaces:
 SlimeWorldInstance
public interface SlimeWorld
extends org.bukkit.persistence.PersistentDataHolder
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.getChunk(int x, int z) Returns the chunk that belongs to the coordinates specified.intConcurrentMap<String, net.kyori.adventure.nbt.BinaryTag> Extra data to be stored alongside the world.Returns theSlimeLoaderused to load and store the world.getName()Returns the name of the world.Returns the property map.Collection<net.kyori.adventure.nbt.CompoundBinaryTag> Returns aCollectionwith every world map, serialized in aCompoundBinaryTagobject.booleanReturns whether read-only is enabled.Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer 
- 
Method Details
- 
getName
String getName()Returns the name of the world.- Returns:
 - The name of the world.
 
 - 
getLoader
SlimeLoader getLoader()Returns theSlimeLoaderused to load and store the world.- Returns:
 - The 
SlimeLoaderused 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 
SlimeChunkthat belongs to those coordinates. 
 - 
getChunkStorage
Collection<SlimeChunk> getChunkStorage() - 
getExtraData
ConcurrentMap<String,net.kyori.adventure.nbt.BinaryTag> getExtraData()Extra data to be stored alongside the world.Any information can be stored inside this map, it will be serialized into a
CompoundBinaryTagand stored alongside the world data so it can then be retrieved later.- Returns:
 - A Map containing the extra data of the world.
 - API Note
 - There is a maximum limit of 512 nested tags
 - Implementation Requirements
 - The returned map must be an implementation of 
ConcurrentMapto avoid CMEs, etc. 
 - 
getWorldMaps
Collection<net.kyori.adventure.nbt.CompoundBinaryTag> getWorldMaps()Returns aCollectionwith every world map, serialized in aCompoundBinaryTagobject.- Returns:
 - A 
Collectioncontaining every world map. 
 - 
getPropertyMap
SlimePropertyMap getPropertyMap()Returns the property map.- Returns:
 - A 
SlimePropertyMapobject containing all the properties of the world. 
 - 
isReadOnly
boolean isReadOnly()Returns whether 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 thereadOnlyproperty 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- TheSlimeLoaderused to store the world ornullif 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.
 - 
getDataVersion
int getDataVersion() 
 -