From 77264b10a3bd989b2d787b400dd842f0679eed2e Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 2 Nov 2016 04:05:02 +1100 Subject: [PATCH] Updated TaskBuilder (markdown) --- TaskBuilder.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TaskBuilder.md b/TaskBuilder.md index ee368a0..ef96105 100644 --- a/TaskBuilder.md +++ b/TaskBuilder.md @@ -23,12 +23,13 @@ new TaskBuilder() ### SplitTask example Split up a task and run it when the main thread is free. ```Java -//In reality you'd use one of FAWE's async world manipulators (EditSession, AsyncWorld, FaweQueue etc.) +// In reality you'd use one of EditSession, AsyncWorld, FaweQueue instead. // But this is just an example of how you can split up a task with the FAWE API final World world = Bukkit.getWorld("world"); new TaskBuilder() -.syncWhenFree(new TaskBuilder.SplitTask(20) { // Execution will be split into multiple 20ms tasks +// Execution will be split into multiple 20ms tasks +.syncWhenFree(new TaskBuilder.SplitTask(20) { @Override public Object exec(Object previous) { for (int x = 0; x < 100; x++) { @@ -36,6 +37,7 @@ new TaskBuilder() for (int z = 0; z < 100; z++) { world.getBlockAt(x, y, z).setType(Material.STONE); // FAWE will use this point to split the task + // You can have multiple split points split(); } }