-
Notifications
You must be signed in to change notification settings - Fork 225
Fawe TaskManager
Jesse Boyd edited this page Nov 1, 2016
·
2 revisions
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?
}
});
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 outdated, move to https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/
This Wiki is for Legacy Versions (1.8 - 1.12.2). Check here for 1.13+ versions: https://github.com/IntellectualSites/FastAsyncWorldEdit-Documentation/