public MapBlock readMapBlock(Element block, boolean base, MapBlock baseblock) {

		BlockType blocktype;
		PropsType propstype;
		
		if (base || baseblock == null) {
			blocktype = BlockType.FLOOR;
			propstype = PropsType.NONE;
		} else {
			blocktype = baseblock.block.type;
			propstype = baseblock.getProps().type;
		}
		
		try {
			String strType = block.elementText("type");
		
			if (strType != null) {
				int iblocktype = Integer.parseInt(strType);
				if (iblocktype >= 0 && iblocktype < BlockType.COUNT) {
					blocktype = BlockType.values()[iblocktype];
				}
			}
		} catch (Exception e) {
		}
		
		try {
			Element eprops = block.element("props");
		
			if (eprops != null) {
				MapProps mapprops = readMapProps(eprops, propstype);
				if (mapprops != null) {
					return new MapBlock(blocktype, mapprops);
				}
			}
		} catch (Exception e) {
		}

		return new MapBlock(blocktype, propstype);
	}