本文整理汇总了Java中de.slikey.effectlib.util.ParticleEffect类的典型用法代码示例。如果您正苦于以下问题:Java ParticleEffect类的具体用法?Java ParticleEffect怎么用?Java ParticleEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParticleEffect类属于de.slikey.effectlib.util包,在下文中一共展示了ParticleEffect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:26,代码来源:PlayerDataRPG.java
示例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();
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:22,代码来源:BossAIRunnable.java
示例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);
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:19,代码来源:FlightLaunchEffect.java
示例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);
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:19,代码来源:MelodaBombEffect.java
示例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);
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:19,代码来源:HweenPumpkinBombEffect.java
示例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++;
}
}
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:25,代码来源:FireBoltSpell.java
示例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++;
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:20,代码来源:BeamMobSpell.java
示例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++;
}
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:23,代码来源:MelodaIceSpell.java
示例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++;
}
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:24,代码来源:SlimeKingBurstSpell.java
示例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++;
}
}
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:25,代码来源:QuadBeamSpell.java
示例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();
}
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:18,代码来源:BuffManager.java
示例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);
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:26,代码来源:TrinketManager.java
示例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;
}
}
开发者ID:SamaGames,项目名称:Hub,代码行数:23,代码来源:StepEffect.java
示例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);
}
开发者ID:benNek,项目名称:AsgardAscension,代码行数:22,代码来源:RuneManager.java
示例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();
}
}
开发者ID:savior67,项目名称:StickyTracker,代码行数:24,代码来源:Tracker.java
示例16: init
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exp, int arg1, Kleenean arg2, ParseResult arg3) {
num = (Expression<Number>) exp[0];
part = (Expression<ParticleEffect>) exp[1];
location = (Expression<Location>) exp[2];
data = (Expression<ItemStack>) exp[3];
red = (Expression<Number>) exp[4];
green = (Expression<Number>) exp[5];
blue = (Expression<Number>) exp[6];
ox = (Expression<Number>) exp[7];
oy = (Expression<Number>) exp[8];
oz = (Expression<Number>) exp[9];
speed = (Expression<Number>) exp[10];
return true;
}
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:17,代码来源:EffStaticParticles.java
示例17: giveStealth
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public static void giveStealth(Player p, int seconds) {
invis.add(p);
for(Player p2 : plugin.getServer().getOnlinePlayers())
p2.hidePlayer(p);
p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, RTicks.seconds(seconds), 1, true, false));
RParticles.showWithOffset(ParticleEffect.SMOKE_LARGE, p.getLocation().add(0, p.getEyeHeight() * 0.7, 0), 1.0, 15);
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:8,代码来源:StealthManager.java
示例18: removeStealth
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public static void removeStealth(Player p) {
Spell.notify(p, "You are no longer stealthed.");
invis.remove(p);
for(Player p2 : plugin.getServer().getOnlinePlayers())
p2.showPlayer(p);
p.removePotionEffect(PotionEffectType.INVISIBILITY);
RParticles.showWithOffset(ParticleEffect.CLOUD, p.getLocation().add(0, p.getEyeHeight() * 0.7, 0), 1.0, 15);
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:9,代码来源:StealthManager.java
示例19: onRun
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
@Override
public void onRun() {
Location location = getLocation();
location.add(0, 1.0f, 0);
location.add(Math.cos(radialsPerStep * step) * radius, 0, Math.sin(radialsPerStep * step) * radius);
ParticleEffect.NOTE.display(location, visibleRange, 0, 0, 0, .5f, 1);
step++;
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:9,代码来源:MusicalEffect.java
示例20: tickPoison
import de.slikey.effectlib.util.ParticleEffect; //导入依赖的package包/类
public void tickPoison() {
poisonTicks--;
Location loc = entity.getLocation().add(0, entity.getEyeHeight() * 0.6, 0);
BlockData data = new BlockData(Material.STAINED_CLAY, (byte) DyeColor.BLUE.getWoolData());
RParticles.showWithData(ParticleEffect.BLOCK_CRACK, loc, data, 10);
double multiplier = 0.001;
switch (poisonTier) {
default:
case 1:
multiplier = 0.01;
break;
case 2:
multiplier = 0.015;
break;
case 3:
multiplier = 0.020;
break;
case 4:
multiplier = 0.030;
break;
case 5:
multiplier = 0.050;
break;
}
int amount = (int) (multiplier * hp);
if (amount < 1)
amount = 1;
damage(amount, null, DamageType.ENVIRONMENTAL_INSTANT);
}
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:30,代码来源:MobData.java
注:本文中的de.slikey.effectlib.util.ParticleEffect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论