mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-09-28 13:47:26 +02:00
Update support for new Residence configuration file layout
This commit is contained in:
parent
7d79301293
commit
dd4d448fc5
@ -55,6 +55,25 @@ public class RegionHandler extends FileHandler {
|
||||
else if(regiontype.equals("Factions")) {
|
||||
regionData = factions.getRegionData(worldname);
|
||||
}
|
||||
else if(regiontype.equals("Residence")) {
|
||||
File f = new File("plugins/Residence/Save/Worlds", "res_" + worldname + ".yml");
|
||||
if(f.exists()) {
|
||||
regionConfig = new org.bukkit.util.config.Configuration(f);
|
||||
}
|
||||
else {
|
||||
f = new File("plugins/Residence", "res.yml");
|
||||
if(f.exists()) {
|
||||
regionConfig = new org.bukkit.util.config.Configuration(f);
|
||||
}
|
||||
}
|
||||
if(regionConfig == null) return null;
|
||||
regionConfig.load();
|
||||
regionData = (Map<?, ?>) regionConfig.getProperty("Residences");
|
||||
if(regionData == null) {
|
||||
Log.severe("Region data from " + f.getPath() + " does not include basenode 'Residences'");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* If using worldpath, format is either plugins/<plugin>/<worldname>/<filename> OR
|
||||
* plugins/<plugin>/worlds/<worldname>/<filename>
|
||||
|
@ -73,7 +73,7 @@ public class RegionsComponent extends ClientComponent {
|
||||
{
|
||||
File outputFile;
|
||||
org.bukkit.util.config.Configuration regionConfig = null;
|
||||
Map<?, ?> regionData;
|
||||
Map<?, ?> regionData = null;
|
||||
File webWorldPath;
|
||||
|
||||
if(regiontype.equals("Towny")) {
|
||||
@ -86,10 +86,27 @@ public class RegionsComponent extends ClientComponent {
|
||||
outputFileName = "factions_" + wname + ".json";
|
||||
webWorldPath = new File(plugin.getWebPath()+"/standalone/", outputFileName);
|
||||
}
|
||||
else if(regiontype.equals("Residence")) {
|
||||
File f = new File("plugins/Residence/Save/Worlds", "res_" + wname + ".yml");
|
||||
if(f.exists()) {
|
||||
regionConfig = new org.bukkit.util.config.Configuration(f);
|
||||
}
|
||||
else {
|
||||
f = new File("plugins/Residence", "res.yml");
|
||||
if(f.exists()) {
|
||||
regionConfig = new org.bukkit.util.config.Configuration(f);
|
||||
}
|
||||
}
|
||||
if(regionConfig == null) return;
|
||||
outputFileName = "res_" + wname + ".json";
|
||||
webWorldPath = new File(plugin.getWebPath()+"/standalone/", outputFileName);
|
||||
regionConfig.load();
|
||||
regionData = (Map<?, ?>) regionConfig.getProperty("Residences");
|
||||
}
|
||||
else {
|
||||
if(configuration.getBoolean("useworldpath", false))
|
||||
{
|
||||
if(new File("plugins/"+configuration.getString("name", "WorldGuard"), regionFile).exists())
|
||||
if(new File("plugins/"+regiontype, regionFile).exists())
|
||||
regionConfig = new org.bukkit.util.config.Configuration(new File("plugins/"+regiontype, regionFile));
|
||||
else if(new File("plugins/"+regiontype+"/worlds", regionFile).exists())
|
||||
regionConfig = new org.bukkit.util.config.Configuration(new File("plugins/"+regiontype+"/worlds", regionFile));
|
||||
|
Loading…
Reference in New Issue
Block a user