mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
@ -20,6 +20,8 @@
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.boydti.fawe.beta.implementation.lighting.NullRelighter;
|
||||
import com.boydti.fawe.beta.implementation.lighting.Relighter;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
@ -224,12 +226,12 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
private final int maxY;
|
||||
private final List<WatchdogTickingExtent> watchdogExtents = new ArrayList<>(2);
|
||||
|
||||
private final Relighter relighter;
|
||||
private final boolean wnaMode;
|
||||
|
||||
@Nullable
|
||||
private final Region[] allowedRegions;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public EditSession(@NotNull EventBus bus, World world, @Nullable Player player,
|
||||
@Nullable FaweLimit limit, @Nullable AbstractChangeSet changeSet,
|
||||
@ -264,6 +266,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
this.maxY = world.getMaxY();
|
||||
this.blockBag = builder.getBlockBag();
|
||||
this.history = changeSet != null;
|
||||
this.relighter = builder.getRelighter();
|
||||
this.wnaMode = builder.isWNAMode();
|
||||
this.allowedRegions = builder.getAllowedRegions() != null ? builder.getAllowedRegions().clone() : null;
|
||||
}
|
||||
@ -1093,6 +1096,25 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
}
|
||||
// Reset limit
|
||||
limit.set(originalLimit);
|
||||
try {
|
||||
if (relighter != null && !(relighter instanceof NullRelighter)) {
|
||||
// Only relight once!
|
||||
if (!relighter.getLock().tryLock()) {
|
||||
relighter.getLock().lock();
|
||||
relighter.getLock().unlock();
|
||||
} else {
|
||||
if (Settings.IMP.LIGHTING.REMOVE_FIRST) {
|
||||
relighter.removeAndRelight(true);
|
||||
} else {
|
||||
relighter.fixSkyLighting();
|
||||
relighter.fixBlockLighting();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
player.printError(TranslatableComponent.of("fawe.error.lighting"));
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Enqueue it
|
||||
if (getChangeSet() != null) {
|
||||
if (Settings.IMP.HISTORY.COMBINE_STAGES) {
|
||||
|
Reference in New Issue
Block a user