mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-06-22 09:44:59 +02:00
Force save after claim migration.
This commit is contained in:
parent
a51c954c78
commit
4433d9c2f3
|
@ -164,6 +164,7 @@ public ClaimStorageData(Path path, UUID worldUniqueId) {
|
|||
try {
|
||||
this.root = this.loader.load(ConfigurationOptions.defaults());
|
||||
CommentedConfigurationNode rootNode = this.root.getNode(GriefDefenderPlugin.MOD_ID);
|
||||
boolean requiresSave = false;
|
||||
// Check if server is using existing Sponge GP data
|
||||
if (rootNode.isVirtual()) {
|
||||
// check GriefPrevention
|
||||
|
@ -171,9 +172,13 @@ public ClaimStorageData(Path path, UUID worldUniqueId) {
|
|||
if (!gpRootNode.isVirtual()) {
|
||||
rootNode.setValue(gpRootNode.getValue());
|
||||
gpRootNode.setValue(null);
|
||||
requiresSave = true;
|
||||
}
|
||||
}
|
||||
this.configBase = this.configMapper.populate(rootNode);
|
||||
if (requiresSave) {
|
||||
this.save();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
GriefDefenderPlugin.getInstance().getLogger().log(Level.SEVERE, "Failed to load configuration", e);
|
||||
}
|
||||
|
|
|
@ -429,7 +429,7 @@ public GDClaim loadClaim(File claimFile, World world, UUID claimId)
|
|||
t.printStackTrace();
|
||||
}
|
||||
if (parentClaim == null) {
|
||||
throw new Exception("Required parent claim '" + parent + " no longer exists. Skipping...");
|
||||
throw new Exception("Unable to load claim file '" + claimFile.getAbsolutePath() + "'. Required parent claim '" + parent + "' no longer exists. Skipping...");
|
||||
}
|
||||
claim.parent = parentClaim;
|
||||
}
|
||||
|
|
|
@ -165,6 +165,7 @@ public ClaimStorageData(Path path, UUID worldUniqueId) {
|
|||
try {
|
||||
this.root = this.loader.load(ConfigurationOptions.defaults());
|
||||
CommentedConfigurationNode rootNode = this.root.getNode(GriefDefenderPlugin.MOD_ID);
|
||||
boolean requiresSave = false;
|
||||
// Check if server is using existing Sponge GP data
|
||||
if (rootNode.isVirtual()) {
|
||||
// check GriefPrevention
|
||||
|
@ -172,9 +173,13 @@ public ClaimStorageData(Path path, UUID worldUniqueId) {
|
|||
if (!gpRootNode.isVirtual()) {
|
||||
rootNode.setValue(gpRootNode.getValue());
|
||||
gpRootNode.setValue(null);
|
||||
requiresSave = true;
|
||||
}
|
||||
}
|
||||
this.configBase = this.configMapper.populate(rootNode);
|
||||
if (requiresSave) {
|
||||
this.save();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
GriefDefenderPlugin.getInstance().getLogger().error("Failed to load configuration", e);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
import com.griefdefender.claim.GDClaim;
|
||||
import com.griefdefender.claim.GDClaimManager;
|
||||
import com.griefdefender.claim.GDClaimResult;
|
||||
import com.griefdefender.claim.GDClaimSchematic;
|
||||
import com.griefdefender.configuration.ClaimStorageData;
|
||||
import com.griefdefender.configuration.ClaimTemplateStorage;
|
||||
import com.griefdefender.configuration.GriefDefenderConfig;
|
||||
|
@ -48,16 +47,11 @@
|
|||
import com.griefdefender.migrator.WorldGuardMigrator;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.data.DataContainer;
|
||||
import org.spongepowered.api.data.persistence.DataFormats;
|
||||
import org.spongepowered.api.data.persistence.DataTranslators;
|
||||
import org.spongepowered.api.scheduler.Task;
|
||||
import org.spongepowered.api.world.DimensionType;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.schematic.Schematic;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -66,7 +60,6 @@
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
public class FileStorage extends BaseStorage {
|
||||
|
||||
|
@ -443,7 +436,7 @@ public GDClaim loadClaim(File claimFile, World world, UUID claimId)
|
|||
t.printStackTrace();
|
||||
}
|
||||
if (parentClaim == null) {
|
||||
throw new Exception("Required parent claim '" + parent + " no longer exists. Skipping...");
|
||||
throw new Exception("Unable to load claim file '" + claimFile.getAbsolutePath() + "'. Required parent claim '" + parent + "' no longer exists. Skipping...");
|
||||
}
|
||||
claim.parent = parentClaim;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user