use of com.elmakers.mine.bukkit.effect.EffectPlayer in project MagicPlugin by elBukkit.
the class EffectVariable method play.
@Override
public void play() {
playing.clear();
if (brightnessMap.size() > 0) {
double brightness = 0;
Color color = getColor1();
if (color != null) {
brightness = color.getRed() / 255.0 + color.getBlue() / 255.0 + color.getGreen() / 255.0;
}
for (Map.Entry<Double, Collection<EffectPlayer>> entry : brightnessMap.entrySet()) {
if (brightness < entry.getKey()) {
for (EffectPlayer player : entry.getValue()) {
// Set scale
player.setScale(scale);
// Set material and color
player.setMaterial(getWorkingMaterial());
player.setColor(getColor1());
player.setParticleOverride(particleOverride == null ? null : particleOverride.name());
player.start(getOrigin(), getOriginEntity(), getTarget(), getTargetEntity());
playing.add(player);
}
break;
}
}
}
}
use of com.elmakers.mine.bukkit.effect.EffectPlayer in project MagicPlugin by elBukkit.
the class WandUpgradePath method playEffects.
protected void playEffects(Mage mage, String effectType) {
Collection<EffectPlayer> players = effects.get(effectType);
if (players == null || mage == null)
return;
Entity sourceEntity = mage.getEntity();
Location mageLocation = mage.getEyeLocation();
for (EffectPlayer player : players) {
player.setColor(mage.getEffectColor());
player.start(mageLocation, sourceEntity, null, null);
}
}
use of com.elmakers.mine.bukkit.effect.EffectPlayer in project MagicPlugin by elBukkit.
the class EffectVariable method load.
@Override
public void load(Plugin plugin, ConfigurationSection configuration) {
super.load(plugin, configuration);
playAtOrigin = false;
playAtTarget = false;
playAtAllTargets = false;
ConfigurationSection brightness = ConfigurationUtils.getConfigurationSection(configuration, "brightness");
Collection<String> keys = brightness.getKeys(false);
for (String key : keys) {
try {
double level = Double.parseDouble(key);
Collection<EffectPlayer> childPlayers = EffectPlayer.loadEffects(plugin, brightness, key);
brightnessMap.put(level, childPlayers);
for (EffectPlayer childPlayer : childPlayers) {
playAtOrigin |= childPlayer.playsAtOrigin();
playAtAllTargets |= childPlayer.playsAtAllTargets();
playAtTarget |= childPlayer.playsAtTarget();
}
} catch (Exception ignored) {
}
}
}
Aggregations