mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 13:45:36 +01:00
parent
dbaa587530
commit
ed08bf8a9c
@ -476,16 +476,49 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ChunkSection[] sections = nmsChunk.getSections();
|
ChunkSection[] sections = nmsChunk.getSections();
|
||||||
|
final boolean flag = craftChunk.getWorld().getEnvironment() == World.Environment.NORMAL;
|
||||||
if (mode == RelightMode.ALL) {
|
if (mode == RelightMode.ALL) {
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (int i = 0; i < sections.length; i++) {
|
||||||
ChunkSection section = sections[i];
|
ChunkSection section = sections[i];
|
||||||
if (section != null) {
|
if (section != null) {
|
||||||
section.a(new NibbleArray());
|
section.a(new NibbleArray());
|
||||||
section.b(new NibbleArray());
|
if (flag) {
|
||||||
|
section.b(new NibbleArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nmsChunk.initLighting();
|
nmsChunk.initLighting();
|
||||||
|
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
if (mode == RelightMode.ALL) {
|
||||||
|
nmsChunk.initLighting();
|
||||||
|
} else {
|
||||||
|
int i = nmsChunk.g();
|
||||||
|
for (int x = 0; x < 16; ++x) {
|
||||||
|
for (int z = 0; z < 16; ++z) {
|
||||||
|
int l = 15;
|
||||||
|
int y = i + 16 - 1;
|
||||||
|
do {
|
||||||
|
int opacity = nmsChunk.getTypeAbs(x, y, z).p();
|
||||||
|
if (opacity == 0 && l != 15) {
|
||||||
|
opacity = 1;
|
||||||
|
}
|
||||||
|
l -= opacity;
|
||||||
|
if (l > 0) {
|
||||||
|
ChunkSection section = sections[y >> 4];
|
||||||
|
if (section != null) {
|
||||||
|
section.a(x, y & 15, z, l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--y;
|
||||||
|
} while (y > 0 && l > 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fc.getTotalRelight() == 0 && mode == RelightMode.MINIMAL) {
|
if (fc.getTotalRelight() == 0 && mode == RelightMode.MINIMAL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -503,6 +536,9 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
char[] array = section.getIdArray();
|
char[] array = section.getIdArray();
|
||||||
|
if (array == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (mode == RelightMode.ALL) {
|
if (mode == RelightMode.ALL) {
|
||||||
for (int k = array.length - 1; k >= 0; k--) {
|
for (int k = array.length - 1; k >= 0; k--) {
|
||||||
final int x = FaweCache.CACHE_X[j][k];
|
final int x = FaweCache.CACHE_X[j][k];
|
||||||
|
@ -200,38 +200,43 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
|||||||
chunk.load(false);
|
chunk.load(false);
|
||||||
}
|
}
|
||||||
net.minecraft.server.v1_9_R2.Chunk c = ((CraftChunk) chunk).getHandle();
|
net.minecraft.server.v1_9_R2.Chunk c = ((CraftChunk) chunk).getHandle();
|
||||||
|
final boolean flag = chunk.getWorld().getEnvironment() == Environment.NORMAL;
|
||||||
ChunkSection[] sections = c.getSections();
|
ChunkSection[] sections = c.getSections();
|
||||||
if (mode == RelightMode.ALL) {
|
if (mode == RelightMode.ALL) {
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (int i = 0; i < sections.length; i++) {
|
||||||
ChunkSection section = sections[i];
|
ChunkSection section = sections[i];
|
||||||
if (section != null) {
|
if (section != null) {
|
||||||
section.a(new NibbleArray());
|
section.a(new NibbleArray());
|
||||||
section.b(new NibbleArray());
|
if (flag) {
|
||||||
|
section.b(new NibbleArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final boolean flag = chunk.getWorld().getEnvironment() == Environment.NORMAL;
|
if (flag) {
|
||||||
if (flag)
|
if (mode == RelightMode.ALL) {
|
||||||
{
|
c.initLighting();
|
||||||
int i = c.g();
|
} else {
|
||||||
for(int x = 0; x < 16; ++x) {
|
int i = c.g();
|
||||||
for (int z = 0; z < 16; ++z) {
|
for (int x = 0; x < 16; ++x) {
|
||||||
int l = 15;
|
for (int z = 0; z < 16; ++z) {
|
||||||
int i1 = i + 16 - 1;
|
int l = 15;
|
||||||
do {
|
int y = i + 16 - 1;
|
||||||
int opacity = c.a(x, i1, z).c();
|
do {
|
||||||
if (opacity == 0 && l != 15) {
|
int opacity = c.a(x, y, z).c();
|
||||||
opacity = 1;
|
if (opacity == 0 && l != 15) {
|
||||||
}
|
opacity = 1;
|
||||||
l -= opacity;
|
|
||||||
if (l > 0) {
|
|
||||||
ChunkSection section = sections[i1 >> 4];
|
|
||||||
if (section != null) {
|
|
||||||
section.a(x, i1 & 15, z, l);
|
|
||||||
}
|
}
|
||||||
}
|
l -= opacity;
|
||||||
--i1;
|
if (l > 0) {
|
||||||
} while (i1 > 0 && l > 0);
|
ChunkSection section = sections[y >> 4];
|
||||||
|
if (section != null) {
|
||||||
|
section.a(x, y & 15, z, l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--y;
|
||||||
|
} while (y > 0 && l > 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -310,7 +315,7 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (final Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (Thread.currentThread() == Fawe.get().getMainThread()) {
|
if (Thread.currentThread() == Fawe.get().getMainThread()) {
|
||||||
MainUtil.handleError(e);
|
MainUtil.handleError(e);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import com.boydti.fawe.config.Settings;
|
|||||||
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
||||||
import com.boydti.fawe.object.changeset.FaweStreamChangeSet;
|
import com.boydti.fawe.object.changeset.FaweStreamChangeSet;
|
||||||
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
|
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
|
||||||
|
import com.boydti.fawe.object.exception.FaweException;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
import com.boydti.fawe.util.TaskManager;
|
import com.boydti.fawe.util.TaskManager;
|
||||||
import com.boydti.fawe.util.WEManager;
|
import com.boydti.fawe.util.WEManager;
|
||||||
@ -402,7 +403,12 @@ public abstract class FawePlayer<T> {
|
|||||||
try {
|
try {
|
||||||
run.run();
|
run.run();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
FaweException faweException = FaweException.get(e);
|
||||||
|
if (faweException != null) {
|
||||||
|
BBC.WORLDEDIT_CANCEL_REASON.send(FawePlayer.this, faweException.getMessage());
|
||||||
|
} else {
|
||||||
|
MainUtil.handleError(e);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
deleteMeta("fawe_action");
|
deleteMeta("fawe_action");
|
||||||
}
|
}
|
||||||
@ -420,7 +426,12 @@ public abstract class FawePlayer<T> {
|
|||||||
try {
|
try {
|
||||||
run.run();
|
run.run();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
FaweException faweException = FaweException.get(e);
|
||||||
|
if (faweException != null) {
|
||||||
|
BBC.WORLDEDIT_CANCEL_REASON.send(FawePlayer.this, faweException.getMessage());
|
||||||
|
} else {
|
||||||
|
MainUtil.handleError(e);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
deleteMeta("fawe_action");
|
deleteMeta("fawe_action");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user