use of me.botsko.prism.utils.MaterialAliases in project Prism-Bukkit by prism.
the class Prism method loadConfig.
/**
* Load configuration and language files.
*/
public void loadConfig() {
final PrismConfig mc = new PrismConfig(this);
config = mc.getConfig();
// Cache config arrays we check constantly
illegalBlocks = getConfig().getStringList("prism.appliers.never-place-block").stream().map(Material::matchMaterial).filter(Objects::nonNull).collect(Collectors.toList());
illegalEntities = getConfig().getStringList("prism.appliers.never-spawn-entity").stream().map(s -> {
try {
return EntityType.valueOf(s.toUpperCase());
} catch (Exception e) {
debug(e.getMessage());
}
return null;
}).filter(Objects::nonNull).collect(Collectors.toList());
final ConfigurationSection alertBlocks = getConfig().getConfigurationSection("prism.alerts.ores.blocks");
alertedOres.clear();
if (alertBlocks != null) {
for (final String key : alertBlocks.getKeys(false)) {
Material m = Material.matchMaterial(key.toUpperCase());
String colorString = alertBlocks.getString(key);
if (m == null || colorString == null) {
Prism.log("Could not match alert block:" + key + " color:" + colorString);
continue;
}
TextColor color = TypeUtils.from(colorString);
alertedOres.put(m, color);
}
}
items = new MaterialAliases();
}
Aggregations