classinternalSource
public sealed class Dimension
    permits Overworld, Nether, End

Represents a Base Minecraft World. Extended by Overworld, Nether and End If anyone would need a CustomDimension (modded worlds maybe?), we could do that, but I'm keeping it simple for now

Known subclasses
End, Nether, Overworld

Constructors

public Dimension(File worldFolder, DimensionType type)
Parameters
worldFolderFile
typeDimensionType
public Dimension(File worldFolder)
Like above, but here we're building the DimensionType Object ourselves, using the folder name
Parameters
worldFolderFile

Methods

public void close() throws IOException
Closes all RegionFiles
Throws
IOException
protected File dimensionFolder(RegionCategory category)
Parameters
categoryRegionCategory
Returns
File
public Chunk readChunk(int chunkX, int chunkZ) throws IOException
Like readChunkData, but wrapped in a Chunk for simplified access compared to raw NBT. Returns null when the Chunk has not been generated yet.
Parameters
chunkXint
chunkZint
Returns
Chunk
Throws
IOException
public NbtCompound readChunkData(int chunkX, int chunkZ) throws IOException
Parameters
chunkXint
chunkZint
Returns
NbtCompound
Throws
IOException
public EntityData readEntities(int chunkX, int chunkZ) throws IOException
Like readEntityData, but wrapped in an EntityData for simplified access compared to raw NBT. Returns null when the Chunk has not been generated yet.
Parameters
chunkXint
chunkZint
Returns
EntityData
Throws
IOException
public NbtCompound readEntityData(int chunkX, int chunkZ) throws IOException
Parameters
chunkXint
chunkZint
Returns
NbtCompound
Throws
IOException
public PoiData readPoi(int chunkX, int chunkZ) throws IOException
Like readPoiData, but wrapped in a PoiData for simplified access compared to raw NBT. Returns null when the Chunk has not been generated yet.
Parameters
chunkXint
chunkZint
Returns
PoiData
Throws
IOException
public NbtCompound readPoiData(int chunkX, int chunkZ) throws IOException
Parameters
chunkXint
chunkZint
Returns
NbtCompound
Throws
IOException
public void saveChunkData(Chunk chunk) throws IOException
Serializes and writes a chunk's current data to its region file, creating the region file if it doesn't exist. The chunk's coordinates (chunk.chunkX()/chunkZ()) determine where it's written. Also makes Minecraft rebuild the pois (beds, job sites, ...) of every section Chunk.setBlock touched Takes the world's SessionLock while writing
Parameters
chunkChunk
Throws
IOExceptionIf writing fails, or Minecraft has the world open right now
public void saveEntityData(int chunkX, int chunkZ, NbtCompound entityData) throws IOException
Converts and writes Entity data for the given chunk to its region file, creating the file if it doesn't exist yet. Takes the world's SessionLock while writing
Parameters
chunkXint
chunkZint
entityDataNbtCompound
Throws
IOExceptionIf writing fails, or Minecraft has the world open right now
public void saveEntityData(int chunkX, int chunkZ, EntityData entityData) throws IOException
Like saveEntityData(int, int, NbtCompound), but takes an EntityData instead of requiring a .raw() call.
Parameters
chunkXint
chunkZint
entityDataEntityData
Throws
IOException
public void savePoiData(int chunkX, int chunkZ, NbtCompound poiData) throws IOException
Converts and writes POI (point of interest) data for the given chunk to its region file, creating the file if it doesn't exist yet. Takes the world's SessionLock while writing
Parameters
chunkXint
chunkZint
poiDataNbtCompound
Throws
IOExceptionIf writing fails, or Minecraft has the world open right now
public void savePoiData(int chunkX, int chunkZ, PoiData poiData) throws IOException
Like savePoiData(int, int, NbtCompound), but takes a PoiData instead of requiring a .raw() call.
Parameters
chunkXint
chunkZint
poiDataPoiData
Throws
IOException

Nested types