mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-22 02:25:53 +01:00
Page:
Pasting a schematic
Pages
API
Anvil API
AsyncWorld
Brushes
Clipboard API
Commands
Configuration
Copying a region to another world.
CreateFromImage
Download Instructions: Bukkit Spigot
Fawe TaskManager
FawePlayer
FaweQueue
Home
JavaScript API
Jobs API
Light API
NBT stream API
Packet sending
Pasting a schematic
Permissions
Progress API
Recovering corrupt NBT files (MCA Schematic etc.)
Region restriction API
Registering Custom Masks, Patterns and Transforms
Registering custom brushes or commands
Rollback API
Some tips when using the FAWE API
TaskBuilder
TextureUtil block and biome coloring
Third party loggers
Transforms
Web API
WorldEdit FAWE mask list
WorldEdit EditSession
WorldEdit World Player
WorldEdit and FAWE patterns
10
Pasting a schematic
0xLyptox | Lars edited this page 2019-07-18 23:23:39 +02:00
Pasting a schematic with FAWE
boolean allowUndo = true;
EditSession editSession = ClipboardFormats.findByFile(file).load(file).paste(world, position, allowUndo, !noAir, (Transform) null);
Saving a schematic with FAWE
File file = new File("mySchem.schematic");
Vector bot = new Vector(0, 0, 0); //MUST be a whole number eg integer
Vector top = new Vector(50, 255, 50); //MUST be a whole number eg integer
CuboidRegion region = new CuboidRegion(new BukkitWorld(world), bot, top);
Schematic schem = new Schematic(region);
schem.save(file, ClipboardFormat.SCHEMATIC);
Pasting a schematic without FAWE (1.7 -> 1.12)
File file = new File("myFile"); // The schematic file
Vector to = new Vector(0, 0, 0); // Where you want to paste
World weWorld = new BukkitWorld(world);
WorldData worldData = weWorld.getWorldData();
Clipboard clipboard = ClipboardFormat.SCHEMATIC.getReader(new FileInputStream(file)).read(worldData);
Region region = clipboard.getRegion();
EditSession extent = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1);
AffineTransform transform = new AffineTransform();
//{ // Uncomment this if you want to rotate the schematic
// transform = transform.rotateY(90); // E.g. Rotate 90
// extent = new BlockTransformExtent(clipboard, transform, worldData.getBlockRegistry());
//}
ForwardExtentCopy copy = new ForwardExtentCopy(clipboard, clipboard.getRegion(), clipboard.getOrigin(), extent, to);
if (!transform.isIdentity()) copy.setTransform(transform);
if (ignoreAirBlocks) {
copy.setSourceMask(new ExistingBlockMask(clipboard));
}
Operations.completeLegacy(copy);
extent.flushQueue();
This Wiki is for Legacy Versions (1.8 - 1.12.2). Check here for 1.13+ versions: https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/