Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // YAML code
- for (final Entry<String, ConfigurationSection> entry : hero.getSkillSettings().entrySet()) {
- for (final String key : entry.getValue().getKeys(true)) {
- if (entry.getValue().isConfigurationSection(key)) {
- continue;
- }
- config.set(entry.getKey() + "." + key, entry.getValue().get(key));
- }
- }
- // WIP code
- for (Entry<String, ConfigurationSection> entry : heroCopy.getSkillSettings().entrySet()) {
- YamlConfiguration config = new YamlConfiguration();
- for (String key : entry.getValue().getKeys(true)) {
- if (entry.getValue().isConfigurationSection(key)) {
- continue;
- }
- config.set(entry.getKey() + "." + key, entry.getValue().get(key));
- }
- // this is deplorable. saving yaml to a database.
- // but there's no better way :( (or is there?)
- String toSave = config.saveToString();
- // TODO
- // - check if existing row for entry.getKey()
- // - overwrite if exists, insert if doesn't
- // - delete rows that don't have matching keys in getSkillSettings
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement