public static String getParameters(ConfigurationSection parameters) { Collection<String> parameterStrings = new ArrayList<>(); Map<String, Object> map = NMSUtils.getMap(parameters); for (Map.Entry<String, Object> entry : map.entrySet()) { parameterStrings.add(entry.getKey()); parameterStrings.add(entry.getValue().toString()); } return StringUtils.join(parameterStrings, ' '); }
public void wrap(ConfigurationSection wrap) { Map<String, Object> data = NMSUtils.getMap(wrap); if (data != null) { NMSUtils.setMap(this, data); } }
public static ConfigurationSection replaceConfigurations(ConfigurationSection first, ConfigurationSection second) { if (second == null) return first; Map<String, Object> map = NMSUtils.getMap(second); for (Map.Entry<String, Object> entry : map.entrySet()) { first.set(entry.getKey(), entry.getValue()); } return first; }
public static ConfigurationSection overlayConfigurations(ConfigurationSection first, ConfigurationSection second) { if (second == null) return first; Map<String, Object> map = NMSUtils.getMap(second); for (Map.Entry<String, Object> entry : map.entrySet()) { if (!first.contains(entry.getKey())) { first.set(entry.getKey(), entry.getValue()); } } return first; }
@Nullable public static ConfigurationSection replaceParameters(ConfigurationSection configuration, ConfigurationSection parameters) { if (configuration == null) return null; ConfigurationSection replaced = new MemoryConfiguration(); Map<String, Object> map = NMSUtils.getMap(configuration); for (Map.Entry<String, Object> entry : map.entrySet()) { Object value = entry.getValue(); if (value == null) continue; Object replacement = replaceParameters(value, parameters); if (replacement != null) { replaced.set(entry.getKey(), replacement); } } return replaced; }
brushInventory = (Map<String, ? extends Object>)brushInventoryRaw; } else if (brushInventoryRaw instanceof ConfigurationSection) { brushInventory = NMSUtils.getMap((ConfigurationSection)brushInventoryRaw);
public static ConfigurationSection addConfigurations(ConfigurationSection first, ConfigurationSection second, boolean override, boolean requireExisting) Map<String, Object> map = NMSUtils.getMap(second); for (Map.Entry<String, Object> entry : map.entrySet()) { Object value = entry.getValue();
spellInventory = (Map<String, ? extends Object>)spellInventoryRaw; } else if (spellInventoryRaw instanceof ConfigurationSection) { spellInventory = NMSUtils.getMap((ConfigurationSection)spellInventoryRaw);
loadSpellLevels(spellLevels); } else if (spellLevelsRaw instanceof ConfigurationSection) { loadSpellLevels(NMSUtils.getMap((ConfigurationSection)spellLevelsRaw)); loadBrushInventory(brushInventory); } else if (brushInventoryRaw instanceof ConfigurationSection) { loadBrushInventory(NMSUtils.getMap((ConfigurationSection)brushInventoryRaw)); loadSpellInventory(spellInventory); } else if (spellInventoryRaw instanceof ConfigurationSection) { loadSpellInventory(NMSUtils.getMap((ConfigurationSection)spellInventoryRaw));