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); }
protected void updateLocation() { if (origin != null) { origin.update(); } }
/** * 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(); }
/** * 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); } }
/** * 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); }
public void setTargetEntity(Entity entity) { target = new DynamicLocation(entity); }
/** * 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(); }
private ParticleDisplay getDisplay() { if (display == null) { display = ParticleDisplay.newInstance(); } display.setManager(this); return display; }
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); }
/** * 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; }
/** * 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); }
public void setTargetLocation(Location location) { target = new DynamicLocation(location); }
/** * 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(); }
/** * 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(); }
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); }
protected void updateTarget() { if (target != null) { target.update(); } }
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); }
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); }
public void display(Location center, Color color, double range) { display(null, center, color, range, 0, 0, 0, 1, 0); }