Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 19:10:07 +01:00
Synchronizing on accessing a lock is pointless.
Dieser Commit ist enthalten in:
Ursprung
f69b1bfb21
Commit
b1e8c6c3ba
@ -95,7 +95,7 @@ public class NMSRelighter implements Relighter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized ReentrantLock getLock() {
|
||||
public ReentrantLock getLock() {
|
||||
return lightingLock;
|
||||
}
|
||||
|
||||
|
@ -1099,7 +1099,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
try {
|
||||
if (relighter != null && !(relighter instanceof NullRelighter)) {
|
||||
// Only relight once!
|
||||
if (!relighter.getLock().tryLock()) {
|
||||
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING && !relighter.getLock().tryLock()) {
|
||||
relighter.getLock().lock();
|
||||
relighter.getLock().unlock();
|
||||
} else {
|
||||
@ -1109,6 +1109,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
relighter.fixSkyLighting();
|
||||
relighter.fixBlockLighting();
|
||||
}
|
||||
if (Settings.IMP.LIGHTING.DELAY_PACKET_SENDING) {
|
||||
relighter.getLock().unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren