Fix handling of non-standard town_block_size values
This commit is contained in:
parent
ce25b01683
commit
3d53fe3aae
1 changed files with 6 additions and 1 deletions
|
|
@ -32,7 +32,12 @@ public class TownyConfigHandler {
|
||||||
}
|
}
|
||||||
Configuration tcfg = new Configuration(cfgfile);
|
Configuration tcfg = new Configuration(cfgfile);
|
||||||
tcfg.load();
|
tcfg.load();
|
||||||
townblocksize = tcfg.getInt("town_block_size", 16); /* Get block size */
|
String tbsize = tcfg.getNode("town").getString("town_block_size", "16");
|
||||||
|
try {
|
||||||
|
townblocksize = Integer.valueOf(tbsize);
|
||||||
|
} catch (NumberFormatException nfx) {
|
||||||
|
townblocksize = 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get map of attributes for given world
|
* Get map of attributes for given world
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue