private boolean onBurn(Block block) {
Location loc = block.getLocation();
Coord coord = Coord.parseCoord(loc);
TownyWorld townyWorld;
try {
townyWorld = TownyUniverse.getDataSource().getWorld(loc.getWorld().getName());
if (!townyWorld.isUsingTowny())
return false;
try {
if (townyWorld.isWarZone(coord)) {
if (TownyWarConfig.isAllowingFireInWarZone()) {
return false;
} else {
TownyMessaging.sendDebugMsg("onBlockIgnite: Canceled " + block.getTypeId() + " from igniting within "+coord.toString()+".");
return true;
}
}
TownBlock townBlock = townyWorld.getTownBlock(coord);
if ((block.getRelative(BlockFace.DOWN).getType() != Material.OBSIDIAN && !townBlock.getTown().isFire() && !townyWorld.isForceFire() && !townBlock.getPermissions().fire)
|| (block.getRelative(BlockFace.DOWN).getType() != Material.OBSIDIAN && plugin.getTownyUniverse().isWarTime() && TownySettings.isAllowWarBlockGriefing() && !townBlock.getTown().hasNation())) {
TownyMessaging.sendDebugMsg("onBlockIgnite: Canceled " + block.getTypeId() + " from igniting within "+coord.toString()+".");
return true;
}
} catch (TownyException x) {
// Not a town so check the world setting for fire
if (!townyWorld.isFire()) {
TownyMessaging.sendDebugMsg("onBlockIgnite: Canceled " + block.getTypeId() + " from igniting within "+coord.toString()+".");
return true;
}
}