All Projects → BlockHorizons → libschematic

BlockHorizons / libschematic

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

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to libschematic

OpenNoteBlockStudio
An open-source Minecraft music maker.
Stars: ✭ 408 (+1940%)
Mutual labels:  schematic
nbtschematic
A simple schematic file reader for nbtlib
Stars: ✭ 12 (-40%)
Mutual labels:  schematic
copper
An open source PCB editor in rust
Stars: ✭ 26 (+30%)
Mutual labels:  schematic
devirion
Plugin used for debugging virions or plugins that use virions.
Stars: ✭ 35 (+75%)
Mutual labels:  poggit-virions
skinapi
A virion library for saving, modifying and getting skins from png's
Stars: ✭ 19 (-5%)
Mutual labels:  pmmp-virion
SchematicWebViewer
An NPM package to facilitate importing and viewing of modern Minecraft schematics.
Stars: ✭ 44 (+120%)
Mutual labels:  schematic
ngrx-entity-schematic
Angular schematic for quickly scaffolding NgRx Entities
Stars: ✭ 26 (+30%)
Mutual labels:  schematic
poggit
GitHub application for managing PocketMine-family plugins, and website for sharing plugins.
Stars: ✭ 96 (+380%)
Mutual labels:  poggit-virions

libschematic

A library for creating and manipulating MCEdit Schematic files.

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->level->setBlock($target->add($block), $block);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].