mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-06 08:28:14 +01:00
Don't unlight border chunks
This commit is contained in:
parent
8d5e329eea
commit
bcbf307e8d
@ -6,6 +6,7 @@ import com.boydti.fawe.object.FaweChunk;
|
|||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.object.IntegerTrio;
|
import com.boydti.fawe.object.IntegerTrio;
|
||||||
import com.boydti.fawe.object.RunnableVal;
|
import com.boydti.fawe.object.RunnableVal;
|
||||||
|
import com.boydti.fawe.object.collection.LocalBlockVector2DSet;
|
||||||
import com.boydti.fawe.util.MathMan;
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.boydti.fawe.util.TaskManager;
|
import com.boydti.fawe.util.TaskManager;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||||
@ -100,6 +101,14 @@ public class NMSRelighter implements Relighter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized void clear() {
|
||||||
|
queuedSkyToRelight.clear();
|
||||||
|
skyToRelight.clear();
|
||||||
|
chunksToSend.clear();
|
||||||
|
lightQueue.clear();
|
||||||
|
concurrentLightQueue.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean addChunk(int cx, int cz, byte[] fix, int bitmask) {
|
public boolean addChunk(int cx, int cz, byte[] fix, int bitmask) {
|
||||||
RelightSkyEntry toPut = new RelightSkyEntry(cx, cz, fix, bitmask);
|
RelightSkyEntry toPut = new RelightSkyEntry(cx, cz, fix, bitmask);
|
||||||
queuedSkyToRelight.add(toPut);
|
queuedSkyToRelight.add(toPut);
|
||||||
@ -380,6 +389,23 @@ public class NMSRelighter implements Relighter {
|
|||||||
|
|
||||||
private void fixSkyLighting(List<RelightSkyEntry> sorted) {
|
private void fixSkyLighting(List<RelightSkyEntry> sorted) {
|
||||||
RelightSkyEntry[] chunks = sorted.toArray(new RelightSkyEntry[sorted.size()]);
|
RelightSkyEntry[] chunks = sorted.toArray(new RelightSkyEntry[sorted.size()]);
|
||||||
|
boolean remove = this.removeFirst;
|
||||||
|
LocalBlockVector2DSet chunkSet = null;
|
||||||
|
if (remove) {
|
||||||
|
chunkSet = new LocalBlockVector2DSet();
|
||||||
|
LocalBlockVector2DSet tmpSet = new LocalBlockVector2DSet();
|
||||||
|
for (RelightSkyEntry chunk : chunks) {
|
||||||
|
chunkSet.add(chunk.x, chunk.z);
|
||||||
|
}
|
||||||
|
for (RelightSkyEntry chunk : chunks) {
|
||||||
|
int x = chunk.x;
|
||||||
|
int z = chunk.z;
|
||||||
|
if (tmpSet.contains(x + 1, z) && tmpSet.contains(x - 1, z) && tmpSet.contains(x, z + 1) && tmpSet.contains(x, z - 1)) {
|
||||||
|
chunkSet.add(x, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
byte[] cacheX = FaweCache.CACHE_X[0];
|
byte[] cacheX = FaweCache.CACHE_X[0];
|
||||||
byte[] cacheZ = FaweCache.CACHE_Z[0];
|
byte[] cacheZ = FaweCache.CACHE_Z[0];
|
||||||
for (int y = FaweChunk.HEIGHT - 1; y > 0; y--) {
|
for (int y = FaweChunk.HEIGHT - 1; y > 0; y--) {
|
||||||
@ -401,7 +427,7 @@ public class NMSRelighter implements Relighter {
|
|||||||
if (section == null) continue;
|
if (section == null) continue;
|
||||||
chunk.smooth = false;
|
chunk.smooth = false;
|
||||||
|
|
||||||
if (removeFirst && (y & 15) == 15) {
|
if (remove && (y & 15) == 15 && chunkSet.contains(chunk.x, chunk.z)) {
|
||||||
queue.removeSectionLighting(section, y >> 4, true);
|
queue.removeSectionLighting(section, y >> 4, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@ public class NullRelighter implements Relighter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeLighting() {
|
public void removeLighting() {
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ public interface Relighter {
|
|||||||
fixLightingSafe(sky);
|
fixLightingSafe(sky);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
void removeLighting();
|
void removeLighting();
|
||||||
|
|
||||||
void fixBlockLighting();
|
void fixBlockLighting();
|
||||||
|
Loading…
Reference in New Issue
Block a user