LogoLogo
JavaDocsVersions
  • Introduction
  • Getting started
    • Dependencies
    • Your first server
  • Feature
    • Adventure
    • Player capabilities
    • Events
      • Implementation
      • Server list ping
    • Items
    • Entities
      • AI
    • Tags
    • Schedulers
    • Commands
    • Inventories
    • Player UUID
    • Player skin
    • Permissions
    • Advancements
    • Map rendering
      • GLFWMapRendering
    • Query system
    • Open to LAN
  • Thread Architecture
    • Thread safety in the JVM
    • Acquirable API
      • The inside
  • World
    • Instances
    • Chunk management
      • Anvil Loader
    • Blocks
    • Coordinates
    • Generation
    • Batch
  • Extension System
    • Extensions
Powered by GitBook
On this page
  • Loading a world using AnvilLoader
  • Saving a world

Was this helpful?

Export as PDF
  1. World
  2. Chunk management

Anvil Loader

This page describes how to load a world folder using AnvilLoader

Loading a world using AnvilLoader

In order to load a world into an instance, use the InstanceContainer#setChunkLoader(IChunkLoader) function.

An example of using this method to load a world is:

InstanceContainer.setChunkLoader(new AnvilLoader("worlds/world"));

This will load the world inside of the worlds/world directory into the InstanceContainer, allowing you to use the instance as before but having the world loaded inside.

In order to load a world, the world folder will only need the /region folder, as it contains the block data.

Saving a world

In order to save a world, you will have to use the InstanceContainer#saveChunksToStorage() function, this will only work if you have previously loaded a world into the instance using AnvilLoader.

PreviousChunk managementNextBlocks

Last updated 1 year ago

Was this helpful?