rentalslobi.blogg.se

Aasync worldedit
Aasync worldedit










aasync worldedit
  1. #Aasync worldedit how to
  2. #Aasync worldedit mods
  3. #Aasync worldedit code

#Aasync worldedit mods

However, as I've added on more mods, I've adopted Forge as my "premier" modding API, since most of the mods that add new objects and such that I like are all Forge mods. Don't forget to close the writer, or use a try-with-resources statement, so that the changes get flushed to disk.I'm relatively new to modding, but I've become "attached" to WorldEdit, and I'm glad it's available for all of the popular modding platforms. Call write(Clipboard) and pass in the clipboard to write to the file. This is accessed via BuildInClipboardFormat.SPONGE_SCHEMATIC.įrom here, create an OutputStream (such as a FileOutputStream) and pass it to the getWriter(OutputStream) method of the ClipboardFormat to get a writer. Currently, as of writing, the Sponge Schematic Format is the recommended one.

aasync worldedit

To save a clipboard to file, you must first choose what format you're saving in. getWorld ( ), - 1 ) ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy (editSession, region, clipboard, region. From here, you can use a clipboard to paste elsewhere or save to a schematic.ĬuboidRegion region = new CuboidRegion (world, min, max ) BlockArra圜lipboard clipboard = new BlockArra圜lipboard (region ) EditSession editSession = WorldEdit. If you wish to copy entities, you can set the setCopyingEntities method to true on the operation.įrom here you can just run the operation with plete and the region area will be copied into the clipboard. The constructor arguments you use should be the EditSession, the region, the clipboard, and the region's minimum point. In this case, from the EditSession to the BlockArra圜lipboard. This class represents an operation that copies from one extent to another. To copy this region into the clipboard, you need to use a ForwardExtentCopy. Next, you need to make an EditSession, the same way as explained in the section on pasting. Then create a BlockArra圜lipboard, passing in the region. Firstly, make a BlockVector3 of both the minimum and maximum points of the region, and then use them in the constructor CuboidRegion(World, BlockVector3, BlockVector3) alongside the world to get a region object. To copy a structure from the world into a Clipboard, you'll need to create a CuboidRegion. getReader ( new FileInputStream (file ) ) ) Copying findByFile (file ) try ( ClipboardReader reader = format.

#Aasync worldedit code

The following code is a complete example:ĬlipboardFormat format = ClipboardFormats. ClipboardReaders are Closeable, meaning they support try-with-resources statements. With that, you can call getReader(InputStream) to get a copy of a ClipboardReader, which provides read() to obtain a Clipboard. Once you have the schematic format, you'll want to create an InputStream from the file (such as a FileInputStream). You can get by file with findByFile, or get by registered alias with findByAlias. The ClipboardFormats file is the centre of this system, containing a few methods to help you find what format something is. Because of this, you can quickly load a clipboard from a file without knowing what kind of schematic it is. In WorldEdit 7 we modified the API to allow other plugins to register new formats, as well as better support for multiple formats. Loading a schematic from a file is relatively simple now. If you're not a developer and want to load and save schematics in-game, see here. To help with this, I've created a simple guide that covers the basics.

#Aasync worldedit how to

Asking how to load, save, paste, and copy schematics are some of the most frequent questions we get about the WorldEdit API.












Aasync worldedit