@SuppressWarnings("unchecked")
	public void load() {
		File configFile = plugin.getConfigFile("gates.yml");
		
		int counter = 0;

		try {
			Yaml yaml = new Yaml();
			Map<String, Object> gatesYaml = (Map<String, Object>) yaml.load(new FileInputStream(configFile));
			
			if (gatesYaml == null) {
				plugin.log.info(plugin.getNameBrackets() + "empty gates.yml - initializing");
				return;
			}
			
			for (Map.Entry<String, Object> thisGate : gatesYaml.entrySet()) {
				String gateName = thisGate.getKey();
				Map<String, Object> gateData = (Map<String, Object>) thisGate.getValue();

				DataGate newGate = new DataGate(plugin, gateName);
				newGate.setLocation(
						(String) gateData.get("world"),
						(Double) gateData.get("locX"),
						(Double) gateData.get("locY"),
						(Double) gateData.get("locZ"),
						((Double) gateData.get("locYaw")).floatValue(),
						((Double) gateData.get("locP")).floatValue());

				newGate.setToll((Double) gateData.get("toll"));
				newGate.setDenySilent((Boolean) gateData.get("denysilent"));

				add(newGate);
				counter++;
			}

			for (Map.Entry<String, Object> thisGate : gatesYaml.entrySet()) {
				String gateName = thisGate.getKey();
				Map<String, Object> gateData = (Map<String, Object>) thisGate.getValue();

				if (gateData.get("target") != null) {
					DataGate thisTarget = get((String) gateData.get("target"));
					
					if (thisTarget == null) {
						plugin.log.warning(plugin.getNameBrackets() + "ignored invalid destination for gate " + gateName);
					} else {
						get(gateName).linkTo(thisTarget, false);
					}
				}
			}

		} catch (Exception ex) {
			ex.printStackTrace();
		}

		plugin.log.info(plugin.getNameBrackets() + "loaded " + counter + " gates");
	}