Search in sources :

Example 1 with VectorTransform

use of de.slikey.effectlib.math.VectorTransform in project MagicPlugin by elBukkit.

the class EffectTransform method load.

@Override
public void load(Plugin plugin, ConfigurationSection parameters) {
    super.load(plugin, parameters);
    ConfigurationSection transform = ConfigurationUtils.getConfigurationSection(parameters, "position_transform");
    if (transform != null) {
        positionTransform = new VectorTransform(transform);
    } else {
        positionTransform = null;
    }
    steps = parameters.getInt("steps", 0);
    maxStep = parameters.getInt("max_steps", 0);
}
Also used : VectorTransform(de.slikey.effectlib.math.VectorTransform) ConfigurationSection(org.bukkit.configuration.ConfigurationSection)

Example 2 with VectorTransform

use of de.slikey.effectlib.math.VectorTransform in project MagicPlugin by elBukkit.

the class CustomProjectileAction method modifyParameters.

public void modifyParameters(ConfigurationSection parameters) {
    gravity = parameters.getDouble("gravity", gravity);
    drag = parameters.getDouble("drag", drag);
    reorient = parameters.getBoolean("reorient", reorient);
    trackEntity = parameters.getBoolean("track_target", trackEntity);
    trackCursorRange = parameters.getDouble("track_range", trackCursorRange);
    trackSpeed = parameters.getDouble("track_speed", trackSpeed);
    if (parameters.contains("velocity_transform")) {
        ConfigurationSection transformParameters = ConfigurationUtils.getConfigurationSection(parameters, "velocity_transform");
        if (transformParameters != null) {
            velocityTransform = new VectorTransform(transformParameters);
        } else if (parameters.contains("velocity_transform")) {
            velocityTransform = null;
        }
    }
    speed = parameters.getDouble("speed", speed);
    speed = parameters.getDouble("velocity", speed * 20);
    // Mainly for legacy purposes, gravity is in terms of original speed.
    gravity *= speed;
    tickSize = parameters.getDouble("tick_size", tickSize);
    ignoreTargeting = parameters.getBoolean("ignore_targeting", ignoreTargeting);
    returnToCaster = parameters.getBoolean("return_to_caster", returnToCaster);
    resetTimeOnPathChange = parameters.getBoolean("reset_time_on_path_change", resetTimeOnPathChange);
    updateLaunchLocation = parameters.getBoolean("update_launch_location", updateLaunchLocation);
    projectileFollowPlayer = parameters.getBoolean("projectile_follow_player", projectileFollowPlayer);
}
Also used : VectorTransform(de.slikey.effectlib.math.VectorTransform) ConfigurationSection(org.bukkit.configuration.ConfigurationSection)

Aggregations

VectorTransform (de.slikey.effectlib.math.VectorTransform)2 ConfigurationSection (org.bukkit.configuration.ConfigurationSection)2