From 7d1ab180c4c297c31851b1c333b83e35de432f18 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 28 Aug 2011 23:12:04 +0800 Subject: [PATCH] Fix handling of non-standard town_block_size values --- src/main/java/org/dynmap/regions/TownyConfigHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dynmap/regions/TownyConfigHandler.java b/src/main/java/org/dynmap/regions/TownyConfigHandler.java index ff8b07fcc..141b117c1 100644 --- a/src/main/java/org/dynmap/regions/TownyConfigHandler.java +++ b/src/main/java/org/dynmap/regions/TownyConfigHandler.java @@ -32,7 +32,12 @@ public TownyConfigHandler(ConfigurationNode cfg) { } Configuration tcfg = new Configuration(cfgfile); 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