mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Synchronizing on accessing a lock is pointless.
This commit is contained in:
parent
f69b1bfb21
commit
b1e8c6c3ba
@ -95,7 +95,7 @@ public class NMSRelighter implements Relighter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized ReentrantLock getLock() {
|
public ReentrantLock getLock() {
|
||||||
return lightingLock;
|
return lightingLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1099,7 +1099,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
|||||||
try {
|
try {
|
||||||
if (relighter != null && !(relighter instanceof NullRelighter)) {
|
if (relighter != null && !(relighter instanceof NullRelighter)) {
|
||||||
// Only relight once!
|
// Only relight once!
|
||||||
if (!relighter.getLock().tryLock()) {
|
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING && !relighter.getLock().tryLock()) {
|
||||||
relighter.getLock().lock();
|
relighter.getLock().lock();
|
||||||
relighter.getLock().unlock();
|
relighter.getLock().unlock();
|
||||||
} else {
|
} else {
|
||||||
@ -1109,6 +1109,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
|||||||
relighter.fixSkyLighting();
|
relighter.fixSkyLighting();
|
||||||
relighter.fixBlockLighting();
|
relighter.fixBlockLighting();
|
||||||
}
|
}
|
||||||
|
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING) {
|
||||||
|
relighter.getLock().unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user