Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Update PropertiesConfiguration. Catch potential NPE.
Dieser Commit ist enthalten in:
Ursprung
e17a35bb15
Commit
31de2a3a09
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.sk89q.worldedit.snapshots;
|
package com.sk89q.worldedit.snapshots;
|
||||||
|
|
||||||
import com.sk89q.worldedit.data.MissingWorldException;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -26,6 +25,8 @@ import java.util.Calendar;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.data.MissingWorldException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author sk89q
|
* @author sk89q
|
||||||
@ -73,6 +74,7 @@ public class SnapshotRepository {
|
|||||||
*/
|
*/
|
||||||
public List<Snapshot> getSnapshots(boolean newestFirst, String worldname) throws MissingWorldException {
|
public List<Snapshot> getSnapshots(boolean newestFirst, String worldname) throws MissingWorldException {
|
||||||
FilenameFilter filter = new FilenameFilter() {
|
FilenameFilter filter = new FilenameFilter() {
|
||||||
|
@Override
|
||||||
public boolean accept(File dir, String name) {
|
public boolean accept(File dir, String name) {
|
||||||
File f = new File(dir, name);
|
File f = new File(dir, name);
|
||||||
return isValidSnapshot(f);
|
return isValidSnapshot(f);
|
||||||
@ -80,6 +82,9 @@ public class SnapshotRepository {
|
|||||||
};
|
};
|
||||||
|
|
||||||
File[] snapshotFiles = dir.listFiles();
|
File[] snapshotFiles = dir.listFiles();
|
||||||
|
if (snapshotFiles == null) {
|
||||||
|
throw new MissingWorldException(worldname);
|
||||||
|
}
|
||||||
List<Snapshot> list = new ArrayList<Snapshot>(snapshotFiles.length);
|
List<Snapshot> list = new ArrayList<Snapshot>(snapshotFiles.length);
|
||||||
|
|
||||||
for (File file : snapshotFiles) {
|
for (File file : snapshotFiles) {
|
||||||
|
@ -28,6 +28,7 @@ import java.io.OutputStream;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.sk89q.util.StringUtil;
|
import com.sk89q.util.StringUtil;
|
||||||
import com.sk89q.worldedit.LocalConfiguration;
|
import com.sk89q.worldedit.LocalConfiguration;
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
@ -80,11 +81,14 @@ public class PropertiesConfiguration extends LocalConfiguration {
|
|||||||
disallowedBlocks = getIntSet("disallowed-blocks", defaultDisallowedBlocks);
|
disallowedBlocks = getIntSet("disallowed-blocks", defaultDisallowedBlocks);
|
||||||
defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit);
|
defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit);
|
||||||
maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit);
|
maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit);
|
||||||
|
defaultMaxPolygonalPoints = getInt("default-max-polygon-points", defaultMaxPolygonalPoints);
|
||||||
|
maxPolygonalPoints = getInt("max-polygon-points", maxPolygonalPoints);
|
||||||
shellSaveType = getString("shell-save-type", shellSaveType);
|
shellSaveType = getString("shell-save-type", shellSaveType);
|
||||||
maxRadius = getInt("max-radius", maxRadius);
|
maxRadius = getInt("max-radius", maxRadius);
|
||||||
maxSuperPickaxeSize = getInt("max-super-pickaxe-size", maxSuperPickaxeSize);
|
maxSuperPickaxeSize = getInt("max-super-pickaxe-size", maxSuperPickaxeSize);
|
||||||
maxBrushRadius = getInt("max-brush-radius", maxBrushRadius);
|
maxBrushRadius = getInt("max-brush-radius", maxBrushRadius);
|
||||||
logCommands = getBool("log-commands", logCommands);
|
logCommands = getBool("log-commands", logCommands);
|
||||||
|
logFile = getString("log-file", logFile);
|
||||||
registerHelp = getBool("register-help", registerHelp);
|
registerHelp = getBool("register-help", registerHelp);
|
||||||
wandItem = getInt("wand-item", wandItem);
|
wandItem = getInt("wand-item", wandItem);
|
||||||
superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop);
|
superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop);
|
||||||
@ -92,10 +96,16 @@ public class PropertiesConfiguration extends LocalConfiguration {
|
|||||||
noDoubleSlash = getBool("no-double-slash", noDoubleSlash);
|
noDoubleSlash = getBool("no-double-slash", noDoubleSlash);
|
||||||
useInventory = getBool("use-inventory", useInventory);
|
useInventory = getBool("use-inventory", useInventory);
|
||||||
useInventoryOverride = getBool("use-inventory-override", useInventoryOverride);
|
useInventoryOverride = getBool("use-inventory-override", useInventoryOverride);
|
||||||
|
useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride);
|
||||||
navigationWand = getInt("nav-wand-item", navigationWand);
|
navigationWand = getInt("nav-wand-item", navigationWand);
|
||||||
navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance);
|
navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance);
|
||||||
scriptTimeout = getInt("scripting-timeout", scriptTimeout);
|
scriptTimeout = getInt("scripting-timeout", scriptTimeout);
|
||||||
|
saveDir = getString("schematic-save-dir", saveDir);
|
||||||
|
scriptsDir = getString("craftscript-dir", scriptsDir);
|
||||||
butcherDefaultRadius = getInt("butcher-default-radius", butcherDefaultRadius);
|
butcherDefaultRadius = getInt("butcher-default-radius", butcherDefaultRadius);
|
||||||
|
butcherMaxRadius = getInt("butcher-max-radius", butcherMaxRadius);
|
||||||
|
allowExtraDataValues = getBool("allow-extra-data-values", allowExtraDataValues);
|
||||||
|
allowSymlinks = getBool("allow-symbolic-links", allowSymlinks);
|
||||||
|
|
||||||
LocalSession.MAX_HISTORY_SIZE = Math.max(15, getInt("history-size", 15));
|
LocalSession.MAX_HISTORY_SIZE = Math.max(15, getInt("history-size", 15));
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren