Tabnine Logo
DynamicLocation.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
de.slikey.effectlib.util.DynamicLocation
constructor

Best Java code snippets using de.slikey.effectlib.util.DynamicLocation.<init> (Showing top 19 results out of 315)

origin: Slikey/EffectLib

public void setTargetEntity(Entity entity) {
  target = new DynamicLocation(entity);
}
origin: Slikey/EffectLib

public void setTargetLocation(Location location) {
  target = new DynamicLocation(location);
}
origin: Slikey/EffectLib

public Effect start(String effectClass, ConfigurationSection parameters, Location origin, Player targetPlayer){
  return start(effectClass, parameters, new DynamicLocation(origin, null), new DynamicLocation(null, null), (ConfigurationSection)null, targetPlayer);
}
origin: elBukkit/MagicPlugin

@Override
public void start(Entity originEntity, Entity targetEntity) {
  startEffects(new DynamicLocation(originEntity), new DynamicLocation(targetEntity));
}
origin: elBukkit/MagicPlugin

@Override
public void start(Location origin, Entity originEntity, Location target, Entity targetEntity) {
  startEffects(new DynamicLocation(origin, originEntity), new DynamicLocation(target, targetEntity));
}
origin: elBukkit/MagicPlugin

public void start(Location origin, Entity originEntity, Collection<Entity> targets) {
  if (targets == null || targets.size() == 0) return;
  DynamicLocation source = new DynamicLocation(origin, originEntity);
  for (Entity targetEntity : targets)
  {
    if (targetEntity == null) continue;
    // This is not really going to work out well for any Effect type but Single!
    // TODO : Perhaps re-visit?
    DynamicLocation target = new DynamicLocation(targetEntity);
    startEffects(source, target);
  }
}
origin: elBukkit/MagicPlugin

@Override
public void start(Location origin, Location target) {
  startEffects(new DynamicLocation(origin), new DynamicLocation(target));
}
origin: Slikey/EffectLib

/**
 * Start an Effect from a Configuration map of parameters.
 *
 * @param effectClass The name of the Effect class to instantiate. If unqualified, defaults to the de.slikey.effectlib.effect namespace.
 * @param parameters A Configuration-driven map of key/value parameters. Each of these will be applied directly to the corresponding field in the Effect instance.
 * @param origin The origin Location
 * @param target The target Location, only used in some Effects (like LineEffect)
 * @param originEntity The origin Entity, the effect will attach to the Entity's Location
 * @param targetEntity The target Entity, only used in some Effects
 * @param parameterMap A map of parameter values to replace. These must start with the "$" character, values in the parameters map that contain a $key will be replaced with the value in this parameterMap.
 * @return
 */
@Deprecated
public Effect start(String effectClass, ConfigurationSection parameters, Location origin, Location target, Entity originEntity, Entity targetEntity, Map<String, String> parameterMap) {
  return start(effectClass, parameters, new DynamicLocation(origin, originEntity), new DynamicLocation(target, targetEntity), parameterMap);
}
origin: Slikey/EffectLib

public void setEntity(Entity entity) {
  setDynamicOrigin(new DynamicLocation(entity));
}
origin: Slikey/EffectLib

public void setLocation(Location location) {
  setDynamicOrigin(new DynamicLocation(location));
}
origin: Co0sh/BetonQuest

@Override
public void run(String playerID) throws QuestRuntimeException {
  Player p = PlayerConverter.getPlayer(playerID);
  Location location = (loc == null) ? p.getLocation() : loc.getLocation(playerID);
  Entity originEntity = (loc == null) ? p : null;
  Player targetPlayer = pr1vate ? p : null;
  EffectLibIntegrator.getEffectManager().start(effectClass,
                         parameters,
                         new DynamicLocation(location, null),
                         new DynamicLocation(null, null),
                         (Map<String, String>) null,
                         targetPlayer);
}
origin: elBukkit/MagicPlugin

  protected void startProjectileEffects(CastContext context, String effectKey) {

    Collection<EffectPlayer> projectileEffects = context.getEffects(effectKey);
    for (EffectPlayer apiEffectPlayer : projectileEffects)
    {
      if (effectLocation == null) {
        effectLocation = new DynamicLocation(actionContext.getTargetLocation());
        effectLocation.setDirection(velocity);
      }
      if (activeProjectileEffects == null) {
        activeProjectileEffects = new ArrayList<>();
      }
      // Hrm- this is ugly, but I don't want the API to depend on EffectLib.
      if (apiEffectPlayer instanceof com.elmakers.mine.bukkit.effect.EffectPlayer)
      {
        com.elmakers.mine.bukkit.effect.EffectPlayer effectPlayer = (com.elmakers.mine.bukkit.effect.EffectPlayer)apiEffectPlayer;
        effectPlayer.setEffectPlayList(activeProjectileEffects);
        if (projectileEffectsUseTarget) {
          Entity sourceEntity = actionContext.getEntity();
          DynamicLocation sourceLocation = sourceEntity == null ? new DynamicLocation(actionContext.getLocation()) : new DynamicLocation(sourceEntity);
          effectPlayer.startEffects(sourceLocation, effectLocation);
        } else {
          effectPlayer.startEffects(effectLocation, null);
        }
      }
    }
  }
}
origin: elBukkit/MagicPlugin

  @Override
  public void iterate() {
    Location origin = getOrigin();
    if (origin == null) return;
    float currentRadius = scale(radius * scale);

    // Randomization
    double startRadians = Math.random() * Math.PI * 2;

    for (int i = 0; i < size; i++) {
      double radians = (double)i / size * Math.PI * 2 + startRadians;
      Vector direction = new Vector(Math.cos(radians) * currentRadius, 0, Math.sin(radians) * currentRadius);
      Location source = origin;
      Location target = getTarget();
      if (playAtOrigin) {
        source = source.clone();
        source.add(direction);
      }
      if (target != null && playAtTarget) {
        target = target.clone();
        target.add(direction);
      }
      playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity()));
    }
  }
}
origin: elBukkit/MagicPlugin

public void iterateSteps(Location originalOrigin, Location originalTarget) {
  for (int i = 0; i < steps; i++) {
    Location source = originalOrigin;
    Location target = originalTarget;
    if (playAtOrigin) {
      source = source.clone();
      source.add(positionTransform.get(source, totalSteps));
    }
    if (target != null && playAtTarget) {
      target = target.clone();
      target.add(positionTransform.get(target, totalSteps));
    }
    playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity()));
    totalSteps++;
    if (maxStep > 0 && totalSteps >= maxStep) {
      totalSteps = 0;
    }
  }
}
origin: Co0sh/BetonQuest

effect.name,
effect.settings,
new DynamicLocation(loc, null),
new DynamicLocation(null, null),
null,
player);
origin: elBukkit/MagicPlugin

public void setTarget(Location location) {
  if (target == null) {
    target = new DynamicLocation(location);
  } else {
    Location targetLocation = target.getLocation();
    targetLocation.setX(location.getX());
    targetLocation.setY(location.getY());
    targetLocation.setZ(location.getZ());
  }
}
origin: elBukkit/MagicPlugin

public void setOrigin(Location location) {
  if (origin == null) {
    origin = new DynamicLocation(location);
  } else {
    Location originLocation = origin.getLocation();
    originLocation.setX(location.getX());
    originLocation.setY(location.getY());
    originLocation.setZ(location.getZ());
  }
}
origin: elBukkit/MagicPlugin

  @Override
  public void iterate() {
    if (positionTransform == null) {
      playEffect();
      return;
    }
    Location origin = getOrigin();
    Location target = getTarget();
    if (origin == null) return;
    if (steps > 0) {
      iterateSteps(origin, target);
      return;
    }

    Location source = origin;
    double t = (double)playTime / 1000;
    if (playAtOrigin) {
      source = source.clone();
      source.add(positionTransform.get(source, t));
    }
    if (target != null && playAtTarget) {
      target = target.clone();
      target.add(positionTransform.get(target, t));
    }
    long now = System.currentTimeMillis();
    playTime += (now - lastIteration);
    lastIteration = now;
    playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity()));
  }
}
origin: elBukkit/MagicPlugin

@Override
public void iterate() {
  Location origin = getOrigin();
  Location target = getTarget();
  if (origin == null) return;
  Vector delta = direction.clone();
  Location source = origin.clone();
  if (playAtOrigin) {
    source.add(delta.multiply(scale(size) + 1));
  }
  if (target != null && playAtTarget) {
    target = target.clone();
    target.add(delta.multiply(-scale(size) + 1));
  }
  playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity()));
}
de.slikey.effectlib.utilDynamicLocation<init>

Popular methods of DynamicLocation

  • addOffset
  • addRelativeOffset
  • getEntity
  • getLocation
  • setDirection
  • updateFrom
  • getEntityLocation
  • hasValidEntity
  • setDirectionOffset
  • setPitch
  • setUpdateDirection
  • setUpdateLocation
  • setUpdateDirection,
  • setUpdateLocation,
  • setYaw,
  • update,
  • updateDirection,
  • updateOffsets

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now