Repository navigation
Schematics
Efnilite edited this page Jul 30, 2019
·
7 revisions
Schematics in Redaktor are very different from other world editing tools. Redaktor uses JSON files to read and store blocks and dimensions, instead of a custom file format, such as .schematic.
This means that if you're trying to save a Schematic, you need to make sure it's in the JSON format.
You can very easily paste Schematics by using the RedaktorAPI:
Schematic schematic = RedaktorAPI.load(String file); // loads a schematic from a file
schematic.paste(Location at); // the bukkit location of where the schematic needs to be pastedExample:
Schematic schematic = RedaktorAPI.load("plugins/Redaktor/schematics/MySchematic.json"); // loads the schematic
schematic.paste(player.getLocation()); // pastes it at player's locationYou can also very easily save Schematics with the RedaktorAPI:
CuboidSelection selection = new CuboidSelection(Location pos1, Location pos2); // the cube that needs to be saved as schematic
Schematic schematic = RedaktorAPI.toSchematic(CuboidSelection selection); // wraps the cuboid to a schematic, so that you can save it
schematic.save(String file); // where the cuboid needs to be savedExample:
CuboidSelection selection = new CuboidSelection(player.getLocation(), player2.getLocation()); // creates a new cuboid
Schematic schematic = RedaktorAPI.toSchematic(selection); // to schematic
schematic.save("plugins/Redaktor/schematics/PlayerCombo.json"); // saves itView the full (and mostly documented) source code here
