Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BlockHorizons/libschematic

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libschematic

A library for creating and manipulating MCEdit Schematic files.

Hits

Implementing into plugins

Best way to implement this code is to use it as a git module or Poggit virion.

Usage

Loading schematic files

try {
	$schematic = new Schematic();
	$schematic->parse("castle.schematic");
} catch (\Throwable $error) {
	// Handle error
}

Filling schematics

$schematic = new Schematic();
$boundingBox = new AxisAlignedBB();

// For generator block providers, a bounding box is required as the size is unknown in advance.
$schematic->setBlocks($boundingBox, $blockGenerator);

$blocks = [];

// For array block providers, the bounding box is calculated automatically.
$schematic->setBlockArray($blocks);

Saving schematic files

try {
    $schematic = new Schematic();
	$schematic->save("castle.schematic");
} catch (\Throwable $error) {
	// Handle error
}

Pasting schematics

$target = $player->getPosition();
foreach($schematic->blocks() as $block) {
	$target->getWorld()->setBlock($target->addVector($block->getPosition()), $block);
}

About

Create and manipulate MCEdit Schematic files in PocketMine-MP plugins.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.