Tabnine Logo
de.slikey.effectlib.util
Code IndexAdd Tabnine to your IDE (free)

How to use de.slikey.effectlib.util

Best Java code snippets using de.slikey.effectlib.util (Showing top 20 results out of 315)

origin: Slikey/EffectLib

public void display(ParticleData data, Location center, Color color, double range, float offsetX, float offsetY, float offsetZ, float speed, int amount, List<Player> targetPlayers) {
  Material material = null;
  byte materialData = 0;
  if (data != null) {
    material = data.material;
    materialData = data.data;
  }
  display(particle, center, offsetX, offsetY, offsetZ, speed, amount, 1, color, material, materialData, range, targetPlayers);
}
origin: Slikey/EffectLib

protected void updateLocation() {
  if (origin != null) {
    origin.update();
  }
}
origin: Slikey/EffectLib

/**
 * Extending Effect classes can use this to determine the Entity this
 * Effect is targeted upon. This is probably a very rare case, such as
 * an Effect that "links" two Entities together somehow. (Idea!)
 *
 * This may return null, even for an Effect that was set with a target Entity,
 * if the Entity gets GC'd.
 */
public Entity getTargetEntity() {
  return target == null ? null : target.getEntity();
}
origin: Slikey/EffectLib

/**
 * Set the Location this Effect is targeting.
 */
public void setDynamicTarget(DynamicLocation location) {
  target = location;
  if (target != null && targetOffset != null) {
    target.addOffset(targetOffset);
  }
  if (target != null) {
    target.setUpdateLocation(updateLocations);
    target.setUpdateDirection(updateDirections);
  }
}
origin: Slikey/EffectLib

/**
 * Displays a particle effect which is only visible for the specified players
 *
 * @param offsetX Maximum distance particles can fly away from the center on the x-axis
 * @param offsetY Maximum distance particles can fly away from the center on the y-axis
 * @param offsetZ Maximum distance particles can fly away from the center on the z-axis
 * @param speed Display speed of the particles
 * @param amount Amount of particles
 * @param center Center location of the effect
 * @param players Receivers of the effect
 * @throws ParticleVersionException If the particle effect is not supported by the server version
 */
public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List<Player> players) throws ParticleVersionException {
  if (!isSupported()) {
    throw new ParticleVersionException("The " + this + " particle effect is not supported by your server version.");
  }
  display(particle, center, offsetX, offsetY, offsetZ, speed, amount, 1, null, null, (byte)0, 0, players);
}
origin: Slikey/EffectLib

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

/**
 * Extending Effect classes should use this method to obtain the
 * current "target" Location of the effect.
 *
 * Unlike getLocation, this may return null.
 */
public final Location getTarget() {
  return target == null ? null : target.getLocation();
}
origin: Slikey/EffectLib

private ParticleDisplay getDisplay() {
  if (display == null) {
    display = ParticleDisplay.newInstance();
  }
  display.setManager(this);
  return display;
}
origin: Slikey/EffectLib

public void display(Particle particle, Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount, float size, Color color, Material material, byte materialData, double range, List<Player> targetPlayers) {
  if (display == null) {
    display = ParticleDisplay.newInstance();
  }
  display.display(particle, center, offsetX, offsetY, offsetZ, speed, amount, size, color, material, materialData, range, targetPlayers);
}
origin: elBukkit/MagicPlugin

protected void checkLocations() {
  if (origin != null) {
    if (originOffset != null) {
      origin.addOffset(originOffset);
    }
  }
  if (target != null) {
    if (targetOffset != null) {
      target.addOffset(targetOffset);
    }
  }
}
origin: Slikey/EffectLib

/**
 * Returns true if a random value between 0 and 1 is less than the specified value.
 */
static public final boolean randomBoolean(float chance) {
  return MathUtils.random() < chance;
}
origin: Slikey/EffectLib

/**
 * Displays a single particle which flies into a determined direction and is only visible for all players within a certain range in the world of @param center
 *
 * @param direction Direction of the particle
 * @param speed Display speed of the particle
 * @param center Center location of the effect
 * @param range Range of the visibility
 * @throws ParticleVersionException If the particle effect is not supported by the server version
 */
public void display(Vector direction, float speed, Location center, double range) throws ParticleVersionException {
  if (!isSupported()) {
    throw new ParticleVersionException("The " + this + " particle effect is not supported by your server version.");
  }
  display(particle, center, (float)direction.getX(), (float)direction.getY(), (float)direction.getZ(),
      speed, 1, 1, null, null, (byte)0, range, null);
}
origin: Slikey/EffectLib

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

/**
 * Extending Effect classes can use this to determine the Entity this
 * Effect is centered upon.
 *
 * This may return null, even for an Effect that was set with an Entity,
 * if the Entity gets GC'd.
 */
public Entity getEntity() {
  return origin == null ? null : origin.getEntity();
}
origin: Slikey/EffectLib

/**
 * Extending Effect classes should use this method to obtain the
 * current "root" Location of the effect.
 *
 * This method will not return null when called from onRun. Effects
 * with invalid locations will be cancelled.
 */
public final Location getLocation() {
  return origin == null ? null : origin.getLocation();
}
origin: Slikey/EffectLib

public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException {
  display(data, offsetX, offsetY, offsetZ, speed, amount, center, range, null);
}
origin: Slikey/EffectLib

protected void updateTarget() {
  if (target != null) {
    target.update();
  }
}
origin: Slikey/EffectLib

public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException {
  display(offsetX, offsetY, offsetZ, speed, amount, center, range, null);
}
origin: Slikey/EffectLib

public void display(ParticleData data, Location center, Color color, double range, float offsetX, float offsetY, float offsetZ, float speed, int amount) {
  display(data, center, color, range, offsetX, offsetY, offsetZ, speed, amount, null);
}
origin: Slikey/EffectLib

public void display(Location center, Color color, double range) {
  display(null, center, color, range, 0, 0, 0, 1, 0);
}
de.slikey.effectlib.util

Most used classes

  • DynamicLocation
    Represents a Location that can move, possibly bound to an Entity.
  • ConfigUtils
  • MathUtils
    Utility and fast math functions. Thanks to Riven on JavaGaming.org for the basis of sin/cos/atan2/fl
  • VectorUtils
  • BaseImageEffect
  • ImageLoadTask,
  • ParticleDisplay,
  • ParticleEffect$ParticleVersionException,
  • ParticleEffect,
  • RandomUtils,
  • StringParser,
  • ParticleDisplay_12,
  • ParticleDisplay_13
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