mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:48:34 +00:00
Upstream Merge
This commit is contained in:
@ -25,14 +25,21 @@ import com.sk89q.worldedit.extent.NullExtent;
|
||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.BlockMaskBuilder;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextUtils;
|
||||
import com.sk89q.worldedit.util.io.file.ArchiveNioSupports;
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.SnapshotDatabase;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.fs.FileSystemSnapshotDatabase;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -44,6 +51,8 @@ import java.util.Set;
|
||||
*/
|
||||
public abstract class LocalConfiguration {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LocalConfiguration.class);
|
||||
|
||||
public boolean profile = false;
|
||||
public boolean traceUnflushedSessions = false;
|
||||
public Set<String> disallowedBlocks = new HashSet<>();
|
||||
@ -55,7 +64,9 @@ public abstract class LocalConfiguration {
|
||||
public int defaultMaxPolyhedronPoints = -1;
|
||||
public int maxPolyhedronPoints = 20;
|
||||
public String shellSaveType = "";
|
||||
public boolean snapshotsConfigured = false;
|
||||
public SnapshotRepository snapshotRepo = null;
|
||||
public SnapshotDatabase snapshotDatabase = null;
|
||||
public int maxRadius = -1;
|
||||
public int maxSuperPickaxeSize = 5;
|
||||
public int maxBrushRadius = 6;
|
||||
@ -193,6 +204,29 @@ public abstract class LocalConfiguration {
|
||||
return new File(".");
|
||||
}
|
||||
|
||||
public void initializeSnapshotConfiguration(String directory, boolean experimental) {
|
||||
// Reset for reload
|
||||
snapshotRepo = null;
|
||||
snapshotDatabase = null;
|
||||
snapshotsConfigured = false;
|
||||
if (!directory.isEmpty()) {
|
||||
if (experimental) {
|
||||
try {
|
||||
snapshotDatabase = FileSystemSnapshotDatabase.maybeCreate(
|
||||
Paths.get(directory),
|
||||
ArchiveNioSupports.combined()
|
||||
);
|
||||
snapshotsConfigured = true;
|
||||
} catch (IOException e) {
|
||||
LOGGER.warn("Failed to open snapshotDatabase", e);
|
||||
}
|
||||
} else {
|
||||
snapshotRepo = new SnapshotRepository(directory);
|
||||
snapshotsConfigured = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String convertLegacyItem(String legacy) {
|
||||
String item = legacy;
|
||||
try {
|
||||
@ -211,6 +245,7 @@ public abstract class LocalConfiguration {
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setDefaultLocaleName(String localeName) {
|
||||
this.defaultLocaleName = localeName;
|
||||
if (localeName.equals("default")) {
|
||||
|
Reference in New Issue
Block a user