Fallback on async relight failure

This commit is contained in:
Jesse Boyd 2016-04-20 04:24:21 +10:00
parent 8f8c4f2c66
commit 6c141f462a
4 changed files with 22 additions and 4 deletions

View File

@ -1,6 +1,6 @@
name: FastAsyncWorldEdit name: FastAsyncWorldEdit
main: com.boydti.fawe.bukkit.FaweBukkit main: com.boydti.fawe.bukkit.FaweBukkit
version: 3.3.15 version: 3.3.16
description: Fast Async WorldEdit plugin description: Fast Async WorldEdit plugin
authors: [Empire92] authors: [Empire92]
loadbefore: [WorldEdit] loadbefore: [WorldEdit]

View File

@ -181,10 +181,13 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
fixLighting(fc, Settings.FIX_ALL_LIGHTING); final boolean result = fixLighting(fc, Settings.FIX_ALL_LIGHTING) || !Settings.ASYNC_LIGHTING;
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
if (!result) {
fixLighting(fc, Settings.FIX_ALL_LIGHTING);
}
Chunk chunk = fc.getChunk(); Chunk chunk = fc.getChunk();
World world = chunk.getWorld(); World world = chunk.getWorld();
final int view = Bukkit.getServer().getViewDistance(); final int view = Bukkit.getServer().getViewDistance();
@ -218,6 +221,9 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 {
final BukkitChunk_1_8 bc = (BukkitChunk_1_8) fc; final BukkitChunk_1_8 bc = (BukkitChunk_1_8) fc;
final Chunk chunk = bc.getChunk(); final Chunk chunk = bc.getChunk();
if (!chunk.isLoaded()) { if (!chunk.isLoaded()) {
if (Fawe.get().getMainThread() != Thread.currentThread()) {
return false;
}
chunk.load(false); chunk.load(false);
} }

View File

@ -170,10 +170,13 @@ public class BukkitQueue_1_9 extends BukkitQueue_0 {
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
fixLighting(fc, Settings.FIX_ALL_LIGHTING); final boolean result = fixLighting(fc, Settings.FIX_ALL_LIGHTING) || !Settings.ASYNC_LIGHTING;
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
if (!result) {
fixLighting(fc, Settings.FIX_ALL_LIGHTING);
}
final Chunk chunk = fc.getChunk(); final Chunk chunk = fc.getChunk();
chunk.getWorld().refreshChunk(fc.getX(), fc.getZ()); chunk.getWorld().refreshChunk(fc.getX(), fc.getZ());
} }
@ -188,6 +191,9 @@ public class BukkitQueue_1_9 extends BukkitQueue_0 {
final BukkitChunk_1_9 bc = (BukkitChunk_1_9) pc; final BukkitChunk_1_9 bc = (BukkitChunk_1_9) pc;
final Chunk chunk = bc.getChunk(); final Chunk chunk = bc.getChunk();
if (!chunk.isLoaded()) { if (!chunk.isLoaded()) {
if (Fawe.get().getMainThread() != Thread.currentThread()) {
return false;
}
chunk.load(false); chunk.load(false);
} }
// Initialize lighting // Initialize lighting

View File

@ -153,10 +153,13 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0 {
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
fixLighting(fc, Settings.FIX_ALL_LIGHTING); final boolean result = fixLighting(fc, Settings.FIX_ALL_LIGHTING) || !Settings.ASYNC_LIGHTING;
TaskManager.IMP.task(new Runnable() { TaskManager.IMP.task(new Runnable() {
@Override @Override
public void run() { public void run() {
if (!result) {
fixLighting(fc, Settings.FIX_ALL_LIGHTING);
}
final Chunk chunk = fc.getChunk(); final Chunk chunk = fc.getChunk();
chunk.getWorld().refreshChunk(fc.getX(), fc.getZ()); chunk.getWorld().refreshChunk(fc.getX(), fc.getZ());
} }
@ -171,6 +174,9 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0 {
final BukkitChunk_1_8 bc = (BukkitChunk_1_8) pc; final BukkitChunk_1_8 bc = (BukkitChunk_1_8) pc;
final Chunk chunk = bc.getChunk(); final Chunk chunk = bc.getChunk();
if (!chunk.isLoaded()) { if (!chunk.isLoaded()) {
if (Fawe.get().getMainThread() != Thread.currentThread()) {
return false;
}
chunk.load(false); chunk.load(false);
} }
// Initialize lighting // Initialize lighting