Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

JSPrismarine/WorldUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChunkUtils

ChunkUtils for JSPrismarine to speed up chunk loading by using WebAssembly.

This includes chunk generation for:

  • SuperFlat

API

While some chunks may include seed names for generation, the response for every generator is as follows:

[
     { name: "minecraft:block_name", x: 0, y: 0, z: 0 }
]

To setblocks in a chunk based on a generator, your code may look something like:

const chunk = new Chunk(10, 10);
const get_blocks: BlockData[] = gen_flat_chunk();
const blockManager: BlockManager = server.getBlockManager();
get_blocks.forEach((block: BlockData) => {
     chunk.setBlock(block.x, block.y, block.z, BlockManager.getBlock(block.name));
});