mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Fix wna when used internally
This commit is contained in:
@ -222,6 +222,8 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
private final int maxY;
|
||||
private final List<WatchdogTickingExtent> watchdogExtents = new ArrayList<>(2);
|
||||
|
||||
private final boolean wnaMode;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public EditSession(@NotNull EventBus bus, World world, @Nullable Player player,
|
||||
@ -257,6 +259,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
this.maxY = world.getMaxY();
|
||||
this.blockBag = builder.getBlockBag();
|
||||
this.history = changeSet != null;
|
||||
this.wnaMode = builder.isWNAMode();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1075,6 +1078,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.level"));
|
||||
}
|
||||
}
|
||||
if (wnaMode) {
|
||||
getWorld().flush();
|
||||
}
|
||||
// Reset limit
|
||||
limit.set(originalLimit);
|
||||
// Enqueue it
|
||||
|
@ -30,6 +30,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.io.Flushable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
@ -186,4 +188,6 @@ public interface WorldNativeAccess<NC, NBS, NP> {
|
||||
onBlockStateChange(pos, oldState, newState);
|
||||
}
|
||||
|
||||
void flush();
|
||||
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.weather.WeatherType;
|
||||
import com.sk89q.worldedit.world.weather.WeatherTypes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -233,4 +234,7 @@ public class NullWorld extends AbstractWorld {
|
||||
public boolean regenerate(Region region, Extent extent, RegenOptions options) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {}
|
||||
}
|
||||
|
@ -401,4 +401,6 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
|
||||
default boolean setBiome(BlockVector3 position, BiomeType biome) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void flush();
|
||||
}
|
||||
|
Reference in New Issue
Block a user