Added support for Towny Advanced 0.75

This commit is contained in:
FrozenCow 2011-08-27 20:24:37 +02:00
parent 069d4c0ce5
commit a3573c7a64

View File

@ -124,6 +124,21 @@ public class TownyConfigHandler {
n = n.substring(idx+1); /* Process remainder as coordinate */ n = n.substring(idx+1); /* Process remainder as coordinate */
} }
if(!worldmatch) continue; if(!worldmatch) continue;
java.util.regex.Matcher towny075Match = towny075Pattern.matcher(n);
if (towny075Match.matches()) {
// Towny Advanced >= 0.75
try {
//int plotType = Integer.valueOf(towny075Match.group(1));
int[] vv = new int[] { Integer.valueOf(towny075Match.group(2)), Integer.valueOf(towny075Match.group(3)) };
blks.setFlag(vv[0], vv[1], true);
nodevals.add(vv);
} catch(NumberFormatException nfx) {
Log.severe("Error parsing block list in Towny - " + townfile.getPath());
return null;
}
} else {
// Towny Advanced < 0.75
String[] v = n.split(","); String[] v = n.split(",");
if(v.length == 2) { if(v.length == 2) {
try { try {
@ -134,6 +149,10 @@ public class TownyConfigHandler {
Log.severe("Error parsing block list in Towny - " + townfile.getPath()); Log.severe("Error parsing block list in Towny - " + townfile.getPath());
return null; return null;
} }
} else {
Log.severe("Invalid block list format in Towny - " + townfile.getPath());
return null;
}
} }
} }
/* If nothing in this world, skip */ /* If nothing in this world, skip */