public EntityAreaEffectCloudData(ConfigurationSection parameters, MageController controller) {
if (parameters.contains("color")) {
ColorHD colorHD = new ColorHD(parameters.getString("color"));
color = colorHD.getColor();
}
if (parameters.contains("base_potion_type")) {
PotionType potionType;
try {
potionType = PotionType.valueOf(parameters.getString("base_potion_type").toUpperCase());
basePotionData = new PotionData(potionType);
} catch (Exception ex) {
controller.getLogger().warning("Invalid base_potion_type: " + parameters.getString("base_potion_type"));
}
}
if (parameters.contains("particle")) {
try {
particle = Particle.valueOf(parameters.getString("particle").toUpperCase());
} catch (Exception ex) {
controller.getLogger().warning("Invalid particle: " + parameters.getString("particle"));
}
}
duration = parameters.getInt("duration", 2000) * 20 / 1000;
durationOnUse = parameters.getInt("duration_on_use", 0) * 20 / 1000;
reapplicationDelay = parameters.getInt("reapplication_delay", 0) * 20 / 1000;
waitTime = parameters.getInt("wait_time", 0) * 20 / 1000;
radius = (float)parameters.getDouble("radius", 5);
radiusOnUse = (float)parameters.getDouble("radius_on_use", 0);
radiusPerTick = (float)parameters.getDouble("radius_per_tick", 0);
potionEffects = ConfigurationUtils.getPotionEffectObjects(parameters, "potion_effects", controller.getLogger());
}