WritableRegionWorldProvider
        
        extends RegionWorldProvider
    
    
            
            in package
            
        
    
            
            implements
                            WritableWorldProvider                    
    
    
        
            This class implements the stuff needed for general region-based world providers to support saving.
While this isn't used at the time of writing, it may come in useful if Java 1.13 Anvil support is ever implemented, or for a custom world format based on the region concept.
Interfaces, Classes, Traits and Enums
Table of Contents
- $path : string
 - $regions : array<string|int, RegionLoader>
 - $worldData : WorldData
 - __construct() : mixed
 - calculateChunkCount() : int
 - close() : void
 - doGarbageCollection() : void
 - generate() : void
 - getAllChunks() : Generator
 - getPath() : string
 - getRegionIndex() : void
 - getWorldData() : WorldData
 - Returns information about the world
 - isValid() : bool
 - loadChunk() : ChunkData|null
 - saveChunk() : void
 - Saves a chunk (usually to disk).
 - deserializeChunk() : ChunkData|null
 - getCompoundList() : array<string|int, CompoundTag>
 - getPcWorldFormatVersion() : int
 - Returns the storage version as per Minecraft PC world formats.
 - getRegion() : RegionLoader|null
 - getRegionFileExtension() : string
 - Returns the file extension used for regions in this region-based format.
 - loadLevelData() : WorldData
 - loadRegion() : RegionLoader
 - pathToRegion() : string
 - Returns the path to a specific region file based on its X/Z coordinates
 - readFixedSizeByteArray() : string
 - serializeChunk() : string
 - unloadRegion() : void
 - createRegionIterator() : RegexIterator
 
Properties
$path
    protected
        string
    $path
    
    
    
    
$regions
    protected
        array<string|int, RegionLoader>
    $regions
     = []
    
    
    
$worldData
    protected
        WorldData
    $worldData
    
    
    
    
Methods
__construct()
    public
                    __construct(string $path) : mixed
        
        Parameters
- $path : string
 
Return values
mixed —calculateChunkCount()
    public
                    calculateChunkCount() : int
        
    
    
        Return values
int —close()
    public
                    close() : void
        
    
    
        Return values
void —doGarbageCollection()
    public
                    doGarbageCollection() : void
        
    
    
        Return values
void —generate()
    public
            static        generate(string $path, string $name, WorldCreationOptions $options) : void
        
        Parameters
- $path : string
 - $name : string
 - $options : WorldCreationOptions
 
Return values
void —getAllChunks()
    public
                    getAllChunks([bool $skipCorrupted = false ][, Logger|null $logger = null ]) : Generator
        
        Parameters
- $skipCorrupted : bool = false
 - $logger : Logger|null = null
 
Return values
Generator —getPath()
    public
                    getPath() : string
        
    
    
        Return values
string —getRegionIndex()
    public
            static        getRegionIndex(int $chunkX, int $chunkZ, int &$regionX, int &$regionZ) : void
    
        Parameters
- $chunkX : int
 - $chunkZ : int
 - $regionX : int
 - 
                    
reference parameter
 - $regionZ : int
 - 
                    
reference parameter
 
Return values
void —getWorldData()
Returns information about the world
    public
                    getWorldData() : WorldData
    
    
    
        Return values
WorldData —isValid()
    public
            static        isValid(string $path) : bool
        
        Parameters
- $path : string
 
Return values
bool —loadChunk()
    public
                    loadChunk(int $chunkX, int $chunkZ) : ChunkData|null
    
        Parameters
- $chunkX : int
 - $chunkZ : int
 
Tags
Return values
ChunkData|null —saveChunk()
Saves a chunk (usually to disk).
    public
                    saveChunk(int $chunkX, int $chunkZ, ChunkData $chunkData) : void
    
        Parameters
- $chunkX : int
 - $chunkZ : int
 - $chunkData : ChunkData
 
Return values
void —deserializeChunk()
    protected
    abstract                deserializeChunk(string $data) : ChunkData|null
    
        Parameters
- $data : string
 
Tags
Return values
ChunkData|null —getCompoundList()
    protected
            static        getCompoundList(string $context, ListTag $list) : array<string|int, CompoundTag>
    
        Parameters
- $context : string
 - $list : ListTag
 
Tags
Return values
array<string|int, CompoundTag> —getPcWorldFormatVersion()
Returns the storage version as per Minecraft PC world formats.
    protected
    abstract        static        getPcWorldFormatVersion() : int
    
    
    
        Return values
int —getRegion()
    protected
                    getRegion(int $regionX, int $regionZ) : RegionLoader|null
        
        Parameters
- $regionX : int
 - $regionZ : int
 
Return values
RegionLoader|null —getRegionFileExtension()
Returns the file extension used for regions in this region-based format.
    protected
    abstract        static        getRegionFileExtension() : string
    
    
    
        Return values
string —loadLevelData()
    protected
    abstract                loadLevelData() : WorldData
    
    
    
    Tags
Return values
WorldData —loadRegion()
    protected
                    loadRegion(int $regionX, int $regionZ) : RegionLoader
        
        Parameters
- $regionX : int
 - $regionZ : int
 
Return values
RegionLoader —pathToRegion()
Returns the path to a specific region file based on its X/Z coordinates
    protected
                    pathToRegion(int $regionX, int $regionZ) : string
    
        Parameters
- $regionX : int
 - $regionZ : int
 
Return values
string —readFixedSizeByteArray()
    protected
            static        readFixedSizeByteArray(CompoundTag $chunk, string $tagName, int $length) : string
        
        Parameters
- $chunk : CompoundTag
 - $tagName : string
 - $length : int
 
Return values
string —serializeChunk()
    protected
    abstract                serializeChunk(ChunkData $chunk) : string
        
        Parameters
- $chunk : ChunkData
 
Return values
string —unloadRegion()
    protected
                    unloadRegion(int $regionX, int $regionZ) : void
        
        Parameters
- $regionX : int
 - $regionZ : int
 
Return values
void —createRegionIterator()
    private
                    createRegionIterator() : RegexIterator