mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
better locking of lighting and use correct method for relight without removing first
Fixes #847
This commit is contained in:
@ -1098,18 +1098,15 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
limit.set(originalLimit);
|
||||
try {
|
||||
if (relighter != null && !(relighter instanceof NullRelighter)) {
|
||||
// Only relight once!
|
||||
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING && !relighter.getLock().tryLock()) {
|
||||
relighter.getLock().lock();
|
||||
relighter.getLock().unlock();
|
||||
} else {
|
||||
if (Settings.IMP.LIGHTING.REMOVE_FIRST) {
|
||||
relighter.removeAndRelight(true);
|
||||
} else {
|
||||
relighter.fixSkyLighting();
|
||||
relighter.fixBlockLighting();
|
||||
}
|
||||
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING) {
|
||||
// Don't relight twice!
|
||||
if (!relighter.isFinished() && relighter.getLock().tryLock()) {
|
||||
try {
|
||||
if (Settings.IMP.LIGHTING.REMOVE_FIRST) {
|
||||
relighter.removeAndRelight(true);
|
||||
} else {
|
||||
relighter.fixLightingSafe(true);
|
||||
}
|
||||
} finally {
|
||||
relighter.getLock().unlock();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user