Added Dirty Flag #149

Merged
SenseiKiwi merged 3 commits from master into master 2014-03-28 19:38:31 +00:00
Showing only changes of commit 0491b55f40 - Show all commits

View File

@@ -242,26 +242,25 @@ public class DDSaveHandler
public static boolean saveAll(Iterable<? extends IPackable<PackedDimData>> dimensions, public static boolean saveAll(Iterable<? extends IPackable<PackedDimData>> dimensions,
List<Integer> blacklist, boolean checkModified) throws IOException List<Integer> blacklist, boolean checkModified) throws IOException
{ {
// Create the data directory for our dimensions
// Don't catch exceptions here. If we can't create this folder,
// the mod should crash to let the user know early on.
// Get the save directory path // Get the save directory path
File saveDirectory = new File(DimensionManager.getCurrentSaveRootDirectory() + "/DimensionalDoors/data/"); File saveDirectory = new File(DimensionManager.getCurrentSaveRootDirectory() + "/DimensionalDoors/data/");
String savePath = saveDirectory.getAbsolutePath(); String savePath = saveDirectory.getAbsolutePath();
// Create the save directory // Create the save directory
// Don't catch exceptions here. If we can't create this folder,
// then the mod should crash to let the user know early on.
Files.createParentDirs(saveDirectory); Files.createParentDirs(saveDirectory);
saveDirectory.mkdir(); saveDirectory.mkdir();
// Create and write the blackList // Create and write the blackList
writeBlacklist(blacklist, savePath); writeBlacklist(blacklist, savePath);
// Write the dimension save data, and remove the ones we save from the mapping // Write the dimension save data
boolean succeeded = true; boolean succeeded = true;
DimDataProcessor writer = new DimDataProcessor(); DimDataProcessor writer = new DimDataProcessor();
for (IPackable<PackedDimData> dimension : dimensions) for (IPackable<PackedDimData> dimension : dimensions)
{ {
// Check if the dimension should be saved
if (!checkModified || dimension.isModified()) if (!checkModified || dimension.isModified())
{ {
if (writeDimension(dimension, writer, savePath + "/dim_")) if (writeDimension(dimension, writer, savePath + "/dim_"))