mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Fix Towny support to handle 0.75.x and 0.74.x
This commit is contained in:
parent
a3573c7a64
commit
ac650656b4
@ -125,22 +125,12 @@ public class TownyConfigHandler {
|
||||
}
|
||||
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;
|
||||
int bidx = n.indexOf(']');
|
||||
if(bidx >= 0) { /* If 0.75 block type present, skip it (we don't care yet) */
|
||||
n = n.substring(bidx+1);
|
||||
}
|
||||
} else {
|
||||
// Towny Advanced < 0.75
|
||||
String[] v = n.split(",");
|
||||
if(v.length == 2) {
|
||||
if(v.length >= 2) { /* Price in 0.75 is third - don't care :) */
|
||||
try {
|
||||
int[] vv = new int[] { Integer.valueOf(v[0]), Integer.valueOf(v[1]) };
|
||||
blks.setFlag(vv[0], vv[1], true);
|
||||
@ -149,12 +139,13 @@ public class TownyConfigHandler {
|
||||
Log.severe("Error parsing block list in Towny - " + townfile.getPath());
|
||||
return null;
|
||||
}
|
||||
} else if(n.startsWith("|")){ /* End of list? */
|
||||
|
||||
} else {
|
||||
Log.severe("Invalid block list format in Towny - " + townfile.getPath());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If nothing in this world, skip */
|
||||
if(nodevals.size() == 0)
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user