use of io.xol.chunkstories.api.workers.Task in project chunkstories by Hugobros3.
the class ChunkRenderDataHolder method requestMeshUpdate.
@Override
public Fence requestMeshUpdate() {
unbakedUpdates.incrementAndGet();
// System.out.println("who did dis");
// Thread.dumpStack();
Task fence;
taskLock.lock();
if (task == null || task.isDone() || task.isCancelled()) {
task = new TaskBakeChunk((ClientChunk) chunk);
chunk.getWorld().getGameContext().tasks().scheduleTask(task);
}
fence = task;
taskLock.unlock();
return fence;
}
use of io.xol.chunkstories.api.workers.Task in project chunkstories by Hugobros3.
the class ChunkLightBaker method requestLightningUpdate.
@Override
public Fence requestLightningUpdate() {
unbakedUpdates.incrementAndGet();
if (world instanceof WorldTool) {
WorldTool tool = (WorldTool) world;
if (!tool.isLightningEnabled()) {
// System.out.println("too soon");
return new TrivialFence();
}
}
Task fence;
taskLock.lock();
if (task == null || task.isDone() || task.isCancelled()) {
task = new TaskLightChunk(chunk, true);
chunk.getWorld().getGameContext().tasks().scheduleTask(task);
}
fence = task;
taskLock.unlock();
return fence;
}
Aggregations