本文整理汇总了Java中de.slikey.effectlib.util.ParticleEffect类的典型用法代码示例。如果您正苦于以下问题:Java ParticleEffect类的具体用法?Java ParticleEffect怎么用?Java ParticleEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParticleEffect类属于de.slikey.effectlib.util包,在下文中一共展示了ParticleEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: giveStealth
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void giveStealth(int seconds) {
stealthed = true;
Player p = getPlayer();
if (p != null && p.isValid())
StealthManager.giveStealth(p, seconds);
final int counter = stealthCounter;
RScheduler.schedule(plugin, new Runnable() {
public void run() {
// if stealth counter hasn't changed, then stealth has not already been removed
// if stealth has been removed, it wont be removed again (this way, past stealth timers won't affect new stealths)
if (stealthCounter == counter)
removeStealth();
}
}, RTicks.seconds(seconds));
RScheduler.schedule(plugin, new Runnable() {
public void run() {
if (stealthCounter == counter && isStealthed()) {
if (p != null && p.isValid()) {
RParticles.showWithOffset(ParticleEffect.SMOKE_NORMAL, p.getLocation().add(0, 1, 0), 1, 8);
}
RScheduler.schedule(plugin, this, RTicks.seconds(0.5));
}
}
}, RTicks.seconds(0.5));
}
示例2: run
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public final void run() {
if(ai.entity == null)
return;
if (ai.target != null && ai.counter % 2 == 0) {
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.CRIT, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.FLAME, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.SPELL_MOB, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.CRIT_MAGIC, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.SMOKE_NORMAL, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.REDSTONE, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
if (Math.random() < 0.5)
RParticles.showWithOffsetPositiveY(ParticleEffect.PORTAL, ai.entity.getLocation().add(0, ai.entity.getEyeHeight() * 0.5, 0), 1.0, 10);
}
tick();
}
示例3: onRun
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@Override
public void onRun() {
double x, y, z;
for (int i = 0; i < 50; i++) {
int count = 20;
do {
count--;
x = RMath.randDouble(0, 2);
y = RMath.randDouble(0, 2);
z = RMath.randDouble(0, 2);
} while (count >= 0 && x * x + y * y + z * z > 4);
x -= 1;
z -= 1;
loc.add(x, y, z);
display(ParticleEffect.REDSTONE, loc, Color.WHITE);
loc.subtract(x, y, z);
}
}
示例4: onRun
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@Override
public void onRun() {
double x, y, z;
for (int i = 0; i < 50; i++) {
int count = 20;
do {
count--;
x = RMath.randDouble(0, 2);
y = RMath.randDouble(0, 2);
z = RMath.randDouble(0, 2);
} while (count >= 0 && x * x + y * y + z * z > 4);
x -= 1;
z -= 1;
loc.add(x, y, z);
display(ParticleEffect.REDSTONE, loc, Color.AQUA);
loc.subtract(x, y, z);
}
}
示例5: onRun
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@Override
public void onRun() {
double x, y, z;
for (int i = 0; i < 50; i++) {
int count = 20;
do {
count--;
x = RMath.randDouble(0, 2);
y = RMath.randDouble(0, 2);
z = RMath.randDouble(0, 2);
} while (count >= 0 && x * x + y * y + z * z > 4);
x -= 1;
z -= 1;
loc.add(x, y, z);
display(ParticleEffect.REDSTONE, loc, Color.ORANGE);
loc.subtract(x, y, z);
}
}
示例6: castSpell
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void castSpell(final LivingEntity caster, final MobData md, Player target) {
final ArrayList<Entity> hit = new ArrayList<Entity>();
for (int height = 1; height <= 3; height++) {
final Location start = md.entity.getLocation();
start.setY(start.getY() + 0.7 * height);
for (Vector v : getVectorsNormal(md.entity)) {
ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), v, range, 2);
int count = 0;
for (int k = 0; k < locs.size(); k++) {
final Location loc = locs.get(k);
RScheduler.schedule(Spell.plugin, new Runnable() {
public void run() {
RParticles.showWithOffset(ParticleEffect.FLAME, loc, 0.2, 1);
int damage = (int) (md.getDamage() * 1.2);
ArrayList<Entity> damaged = Spell.damageNearby(damage, md.entity, loc, 1.0, hit, true, false, true);
hit.addAll(damaged);
}
}, 1 * count);
if (k % 2 == 0)
count++;
}
}
}
}
示例7: castSpell
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void castSpell(final LivingEntity caster, final MobData md, Player target) {
final Vector dir = target.getLocation().toVector().subtract(caster.getLocation().toVector()).normalize();
final Location start = caster.getLocation().add(0, caster.getEyeHeight() * 0.75, 0).add(dir.multiply(0.5));
int count = 0;
final ArrayList<Entity> hit = new ArrayList<Entity>();
ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), dir, range, 1, true);
for (int k = 0; k < locs.size(); k++) {
final Location loc = locs.get(k);
RScheduler.schedule(Spell.plugin, new Runnable() {
public void run() {
RParticles.show(ParticleEffect.CRIT, loc);
int damage = md.getDamage();
hit.addAll(Spell.damageNearby(damage, caster, loc, 1.0, hit, true, false, true));
}
}, 2 * count);
if (k % 2 == 0)
count++;
}
}
示例8: castSpell
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void castSpell(final LivingEntity caster, final MobData md, Player target) {
final ArrayList<Entity> hit = new ArrayList<Entity>();
final Location start = md.entity.getLocation();
start.setY(start.getY() + 1.2);
for (Vector v : getVectorsNormal(md.entity)) {
ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), v, range, 2);
int count = 0;
for (int k = 0; k < locs.size(); k++) {
final Location loc = locs.get(k);
RScheduler.schedule(Spell.plugin, new Runnable() {
public void run() {
ParticleEffect.REDSTONE.display(null, loc, Color.AQUA, 100, 0.2f, 0.2f, 0.2f, 1, 2);
int damage = (int) (md.getDamage() * 1.2);
ArrayList<Entity> damaged = Spell.damageNearby(damage, md.entity, loc, 1.0, hit, true, false, true);
hit.addAll(damaged);
}
}, 1 * count);
if (k % 2 == 0)
count++;
}
}
}
示例9: castSpell
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void castSpell(final LivingEntity caster, final MobData md, Player target) {
md.shout((String) RMath.randObject(PHRASES), 20);
final ArrayList<Entity> hit = new ArrayList<Entity>();
final Location start = md.entity.getLocation();
start.setY(start.getY() + 1.3);
for (Vector v : getVectors(md.entity)) {
ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), v, 15, 4);
int count = 0;
for (int k = 0; k < locs.size(); k++) {
final Location loc = locs.get(k);
RScheduler.schedule(Spell.plugin, new Runnable() {
public void run() {
RParticles.showWithOffset(ParticleEffect.SLIME, loc, 0.2, 1);
int damage = md.getDamage() * 3;
ArrayList<Entity> damaged = Spell.damageNearby(damage, md.entity, loc, 1.0, hit, true, false, true);
hit.addAll(damaged);
}
}, 1 * count);
if (k % 2 == 0)
count++;
}
}
}
示例10: castSpell
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void castSpell(final LivingEntity caster, final MobData md, Player target) {
final ArrayList<Entity> hit = new ArrayList<Entity>();
for (int height = 1; height <= 3; height++) {
final Location start = md.entity.getLocation();
start.setY(start.getY() + 0.7 * height);
for (Vector v : getVectorsNormal(md.entity)) {
ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), v, range, 2);
int count = 0;
for (int k = 0; k < locs.size(); k++) {
final Location loc = locs.get(k);
RScheduler.schedule(Spell.plugin, new Runnable() {
public void run() {
RParticles.showWithOffset(ParticleEffect.CRIT, loc, 0.2, 1);
int damage = (int) (md.getDamage() * 1.2);
ArrayList<Entity> damaged = Spell.damageNearby(damage, md.entity, loc, 1.0, hit, true, false, true);
hit.addAll(damaged);
}
}, 1 * count);
if (k % 2 == 0)
count++;
}
}
}
}
示例11: handleBuff
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public static void handleBuff(Entity player, Entity e) {
if (!(player instanceof Player))
return;
Player p = (Player) player;
PlayerDataRPG pd = plugin.getPD(p);
if (pd != null && buffMap.containsKey(e.getUniqueId())) {
try {
Buff buff = buffMap.remove(e.getUniqueId());
buff.apply(p, pd);
} catch (Exception e2) {
e2.printStackTrace();
}
Location loc = e.getLocation();
RParticles.showWithOffsetPositiveY(ParticleEffect.EXPLOSION_LARGE, loc, 1.0, 10);
e.remove();
}
}
示例12: onPlayerSwapHandItems
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@EventHandler
public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) {
event.setCancelled(true);
try {
PlayerDataRPG pd = plugin.getPD(event.getPlayer());
if (pd != null && pd.isValid()) {
if (pd.trinket != null) {
if (System.currentTimeMillis() > pd.nextTrinketCast) {
pd.sendMessage(ChatColor.GRAY + ">> " + ChatColor.GREEN + "You cast your Trinket Spell, " + ChatColor.YELLOW + pd.trinket.spell.getName() + ChatColor.GREEN + ".");
RParticles.showWithOffsetPositiveY(ParticleEffect.VILLAGER_HAPPY, event.getPlayer().getLocation().add(0, 1, 0), 1.0, 10);
pd.trinket.spell.cast(event.getPlayer(), pd);
pd.nextTrinketCast = System.currentTimeMillis() + pd.trinket.spell.getCooldown() * 1000;
} else {
double diff = ((double) pd.nextTrinketCast - System.currentTimeMillis()) / 1000.0;
pd.sendMessage(ChatColor.RED + "You cannot use your Trinket Spell for another " + String.format("%.1f", diff) + " seconds!");
}
} else {
pd.sendMessage(ChatColor.RED + "You do not have a Trinket equipped! Use " + ChatColor.YELLOW + "/trinket" + ChatColor.RED + " to equip one!");
}
}
} catch (Exception e) {
e.printStackTrace();
}
event.setCancelled(true);
}
示例13: onRun
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@Override
public void onRun()
{
// Prevents an excess of particles
if (last != null && last.getX() == getEntity().getLocation().getX() && last.getZ() == getEntity().getLocation().getZ())
return;
last = getEntity().getLocation();
Block block = this.getEntity().getLocation().add(0, -0.4, 0).getBlock();
Material type = block.getType();
// If the step should be displayed or not
if (type.isBlock() && type.isSolid() && !type.isTransparent()) {
Location loc = getEntity().getLocation();
loc.setY(block.getY());
loc = loc.add(0, 1 + Math.random() / 100, 0);
Vector dir = VectorUtils.rotateAroundAxisY(getEntity().getLocation().getDirection().setY(0).normalize(), p ? 90 : -90).multiply(0.25);
display(ParticleEffect.FOOTSTEP, loc.add(dir.getX(), 0, dir.getZ()), 7, 0);
p = !p;
}
}
示例14: handleFreeze
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
private void handleFreeze(Player player, Rune rune) {
Player target = Utility.getTargetPlayer(player, 10);
if(target == null || !Utility.canAttack(player, target)) {
return;
}
LineEffect eff = new LineEffect(plugin.getEffectManager());
eff.setEntity(player);
eff.setTargetEntity(target);
eff.particle = ParticleEffect.SNOW_SHOVEL;
eff.start();
target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 60, 6));
target.playSound(target.getLocation(), Sound.ENTITY_SNOWMAN_DEATH, 1F, 1F);
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
player.sendMessage(Lang.HEADERS_TOKENS.toString() + Lang.TOKENS_RUNE_APPLY.toString()
.replaceAll("%s", rune.getName()));
target.sendMessage(Lang.HEADERS_TOKENS.toString() + Lang.TOKENS_FROZEN.toString()
.replaceAll("%s", player.getName()));
finish(player, false);
}
示例15: generateTrail
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void generateTrail() {
OfflinePlayer owner = getOwner();
OfflinePlayer target = getTarget();
if(owner != null && owner.isOnline() && target != null && target.isOnline()) {
this.lineEffect = new LineEffect(StickyTracker.getEffectManager());
//lineEffect.particle = ParticleEffect.REDSTONE;
lineEffect.period = 1;
lineEffect.visibleRange = visibility;
lineEffect.isZigZag = false;
lineEffect.updateLocations = true;
lineEffect.updateDirections = true;
//loc.addOffset(getOwner().getVelocity().setY(getOwner().getLocation().getY() - getOwner().getEyeHeight()) );
lineEffect.iterations = -1;
lineEffect.particle = ParticleEffect.PORTAL;
lineEffect.setDynamicOrigin(new DynamicLocation(new Location(((Player) owner).getWorld(), 0, 0, 0)));
lineEffect.setDynamicTarget(new DynamicLocation(new Location(((Player) owner).getWorld(), 0, 0, 0)));
//lineEffect.particleOffsetX = 1;
//lineEffect.particleOffsetY = 1;
lineEffect.start();
}
}