mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-22 02:25:53 +01:00
Page:
WorldEdit EditSession
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
5
WorldEdit EditSession
Alw3ys edited this page 2017-03-16 16:55:04 +01:00
Table of Contents
The EditSession is used by WorldEdit to make and record changes to the World. The EditSessionBuilder gives you full control over it.
- A world must be provided, see
FaweAPI.getWorld(...)
Example:
EditSession editSession = new EditSessionBuilder(world).fastmode(true).build();
Unset values will revert to their default:
- player: The player doing the edit (defaults to to null)
- limit: Block/Entity/Action limit (defaults to player limit or unlimited)
- changeSet: Stores changes (defaults to config.yml value)
- allowedRegions: Allowed editable regions (defaults to player's allowed regions, or everywhere)
- autoQueue: Changes can occur before flushQueue() (defaults true)
- fastmode: bypasses history (defaults to player fastmode or config.yml console history)
- checkMemory: If low memory checks are enabled (defaults to player's fastmode or true)
- combineStages: If history is combined with dispatching (defaults to config value)
- blockBag: The blockbag to use (defaults to null)
- eventBus: The eventBus to use (defaults to null)
- event: The event to call (defaults to null)
Here's a non FAWE example:
// If no player is doing the changes
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(worldEditWorld, -1);
// For a specific player
editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(worldEditWorld, -1, actor);
// Do stuff with the EditSession
editSession.setBlock(new Vector(x, y, z), new BaseBlock(id, data));
// All changes will have been made once flushQueue is called
editSession.flushQueue();
Here's a FAWE example:
EditSession editSession = new EditSessionBuilder(world).fastmode(true).build();
editSession.setBlock(new Vector(x, y, z), new BaseBlock(id, data));
editSession.flushQueue();
Undoing an EditSession
Where editSession
is what you are undoing.
// Create a new EditSession however you want
EditSession newEditSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(editSession.getWorld(), -1, null, null);
// Undo it
editSession.undo(newEditSession);
editSession.flushQueue();
This Wiki is for Legacy Versions (1.8 - 1.12.2). Check here for 1.13+ versions: https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/