Page:
Fawe TaskManager
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
2
Fawe TaskManager
Jesse Boyd edited this page 2016-11-02 04:06:38 +11:00
Table of Contents
Async task
Pretty basic stuff, but this is how you run an async task with the FAWE TaskManager
TaskManager.IMP.async(new Runnable() {
@Override
public void run() {
// Do stuff here?
}
});
Sync task
With the FAWE TaskManager to you can switch to the main thread (from an async one) and run a task.
// Get a player's inventory from an async thread
// E.g. if the method isn't safe to use async
PlayerInventory inventory = TaskManager.IMP.sync(new RunnableVal<PlayerInventory>() {
@Override
public void run(PlayerInventory value) {
this.value = player.getInventory();
}
});
When to do this?
- The method you want to call isn't safe to use async
- The are performance issues with doing the task async
This Wiki is for Legacy Versions (1.8 - 1.12.2). Check here for 1.13+ versions: https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/