use of org.bukkit.configuration.file.YamlConfiguration in project WildernessTp by AcmeProject.
the class PortalzGoneWild method savePortal.
public void savePortal(String name, String portal, Player p) {
WildTP.debug("Got save portal " + name + " " + portal);
portalFile = new File(WildTP.instace.getDataFolder(), "Portals.yml");
portalConf = new YamlConfiguration();
try {
portalConf.load(portalFile);
portalConf.set(name, portal);
portalConf.save(portalFile);
} catch (InvalidConfigurationException | IOException e) {
e.printStackTrace();
p.sendMessage("Error occurred, check console logs");
return;
}
p.sendMessage("Portal " + name + " created!");
// dum lax
loadConfig();
}
Aggregations