本文整理汇总了Java中org.inventivetalent.particle.ParticleEffect类的典型用法代码示例。如果您正苦于以下问题:Java ParticleEffect类的具体用法?Java ParticleEffect怎么用?Java ParticleEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParticleEffect类属于org.inventivetalent.particle包,在下文中一共展示了ParticleEffect类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
public void run(PAUser user, String label, String... args) {
final Ocelot o = (Ocelot) user.getLoc().getWorld().spawnEntity(user.getLoc(), EntityType.OCELOT);
o.setCatType(Ocelot.Type.values()[r.nextInt(Ocelot.Type.values().length)]);
o.setSitting(true);
o.setTamed(true);
o.setAge(r.nextInt(2));
o.setCustomName(Utils.colorize("&dGateteeeeeee"));
o.setCustomNameVisible(true);
o.setNoDamageTicks(Integer.MAX_VALUE);
o.setVelocity(user.getPlayer().getLocation().getDirection().multiply(2));
PAServer.users.forEach(u -> u.sendSound(Sounds.CAT_MEOW));
plugin.getServer().getScheduler().runTaskLater(plugin, () -> {
PAServer.users.forEach(u -> u.sendSound(Sounds.EXPLODE));
ParticleEffect.EXPLOSION_HUGE.send(plugin.getServer().getOnlinePlayers(), o.getLocation(), 0, 0, 0, 1, 20, 50);
o.remove();
}, 60);
}
示例2: blockOutline
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
void blockOutline(Player receiver, Vector location, Color color) {
Collection<Player> singleton = Collections.singleton(receiver);
//Center
ParticleEffect.REDSTONE.sendColor(singleton, location.getX(), location.getY() + .5, location.getZ(), color);
//Outline
ParticleEffect.REDSTONE.sendColor(singleton, location.getX(), location.getY(), location.getZ(), color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX(), location.getY(), location.getZ() + 1, color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX() + 1, location.getY(), location.getZ(), color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX() + 1, location.getY(), location.getZ() + 1, color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX(), location.getY() + 1, location.getZ(), color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX(), location.getY() + 1, location.getZ() + 1, color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX() + 1, location.getY() + 1, location.getZ(), color);
ParticleEffect.REDSTONE.sendColor(singleton, location.getX() + 1, location.getY() + 1, location.getZ() + 1, color);
}
示例3: play
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
@Override
public void play(PAUser u) {
if (isInCooldown(u, getName())) return;
final Sheep o = (Sheep) spawnEntity(u.getLoc(), EntityType.SHEEP);
o.setAdult();
o.setColor(DyeColor.values()[r.nextInt(DyeColor.values().length)]);
o.setCustomName(Utils.colorize("&dOveja Fiestera"));
o.setCustomNameVisible(true);
o.setNoDamageTicks(Integer.MAX_VALUE);
o.setVelocity(u.getPlayer().getLocation().getDirection().multiply(2));
PAServer.users.forEach(h -> h.sendSound(Sounds.SHEEP_IDLE));
bt = plugin.getServer().getScheduler().runTaskTimer(plugin, () -> {
ColorParser dc = ColorParser.values()[r.nextInt(ColorParser.values().length)];
o.setColor(dc.getDyeColor());
o.setCustomName(Utils.colorize(dc.getChatColor() + "Oveja Fiestera"));
if (count <= 0) {
PAServer.users.forEach(h -> h.sendSound(Sounds.EXPLODE));
ParticleEffect.EXPLOSION_HUGE.send(plugin.getServer().getOnlinePlayers(), o.getLocation(), 0, 0, 0, 1, 20, 50);
o.remove();
bt.cancel();
return;
}
count--;
}, 0, 20);
}
示例4: display
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
public void display(Player receiver) {
if (receiver == null || !receiver.isOnline()) { return; }
Collection<Player> singleton = Collections.singleton(receiver);
ParticleEffect.REDSTONE.sendColor(singleton, vector.getX(), vector.getY() + .025, vector.getZ(), color);
if (fadeTimeout++ >= 16) {
fadeTimeout=0;
ParticleEffect.FOOTSTEP.send(singleton, vector.getX(), vector.getY() + .01, vector.getZ(), 0, 0, 0, 0, 1);
}
}
示例5: tick
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
@Override
public void tick() {
super.tick();
direction.subtract(new Vector(0, 0.035, 0));
projectile.setVelocity(direction);
ParticleEffect.REDSTONE.sendColor(Collections.singleton(shooter), projectile.getLocation().getX(), projectile.getLocation().getY(), projectile.getLocation().getZ(), Color.RED);
}
示例6: tick
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
@Override
public void tick() {
super.tick();
projectile.setVelocity(direction);
ParticleEffect.REDSTONE.sendColor(Collections.singleton(shooter), projectile.getLocation().getX(), projectile.getLocation().getY(), projectile.getLocation().getZ(), Color.BLUE);
}
示例7: giantAttacks
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
public static void giantAttacks(Giant boss, Player damager){
int attack = r.nextInt(8);
List<Player> near = new ArrayList<>();
boss.getNearbyEntities(7, 7, 7).forEach(en -> {
if (en instanceof Player) {
near.add((Player) en);
}
});
switch (attack){
case 0:
near.forEach(p -> {
if (!p.equals(damager)) {
p.getWorld().strikeLightningEffect(p.getLocation());
plugin.getHealth().damage(TOA.getPlayer(p), 10);
if (r.nextBoolean()) p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 40, 0));
if (r.nextBoolean()) p.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 30, 0));
}
});
damager.getWorld().strikeLightningEffect(damager.getLocation());
plugin.getHealth().damage(TOA.getPlayer(damager), 20);
if (r.nextBoolean()) damager.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 40, 0));
if (r.nextBoolean()) damager.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 30, 0));
break;
case 1:
ArrayList<Location> locs = Utils.getCircle(boss.getEyeLocation(), 7, 30);
locs.forEach(l -> {
ParticleEffect.REDSTONE.sendColor(plugin.getServer().getOnlinePlayers(), l, Color.fromBGR(100, 60, 50));
ParticleEffect.REDSTONE.sendColor(plugin.getServer().getOnlinePlayers(), l.subtract(0, 7, 0), Color.fromBGR(200, 60, 50));
});
near.forEach(p -> {
if (!p.equals(damager)) {
ParticleEffect.EXPLOSION_NORMAL.send(plugin.getServer().getOnlinePlayers(), p.getLocation(), 0, 0, 0, 1, 10);
plugin.getHealth().damage(TOA.getPlayer(p), 30);
}
});
ParticleEffect.EXPLOSION_NORMAL.send(plugin.getServer().getOnlinePlayers(), damager.getLocation(), 0, 0, 0, 1, 10);
plugin.getHealth().damage(TOA.getPlayer(damager), 30);
break;
case 2:
if (boss.getHealth() + 20 >= boss.getMaxHealth()) boss.setHealth(boss.getMaxHealth());
boss.setHealth(boss.getHealth() + 20);
break;
default:
break;
}
}
示例8: run
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
@Override
public void run(){
if(!SQTurrets.isInTurret(p)){
if(CraftManager.getInstance().getCraftByPlayer(p) != null){
if(!CraftManager.getInstance().getCraftByPlayer(p).hasMovedInLastSecond()){
this.cancel();
}
} else {
this.cancel();
}
}
Location loc = p.getEyeLocation();
Vector vec = loc.getDirection();
loc.add(vec);
for(int i = 0; i < (int) getVelocity(); i++){
if(!loc.getBlock().getType().equals(Material.AIR) && i > 0) i = (int) getVelocity();
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc, Color.LIME);
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX()+0.3, loc.getY(), loc.getZ(), Color.LIME);
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX()-0.3, loc.getY(), loc.getZ(), Color.LIME);
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX(), loc.getY(), loc.getZ()+0.3, Color.LIME);
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX(), loc.getY(), loc.getZ()-0.3, Color.LIME);
for (Entity entity : loc.getWorld().getNearbyEntities(loc, 1, 1, 1)) {
if (entity instanceof LivingEntity && entity.getEntityId() != p.getEntityId()) {
i = (int) getVelocity();
LivingEntity target = (LivingEntity) entity;
if(target instanceof Player){
Player ptarget = (Player) target;
if(EmpirePlayer.getOnlinePlayer(ptarget).getEmpire() != EmpirePlayer.getOnlinePlayer(p).getEmpire()){
if(!ptarget.isBlocking()){
ptarget.setHealth(Math.max(0, ptarget.getHealth() - ammo.getYield()));
p.getWorld().playSound(p.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F);
ptarget.getWorld().playSound(ptarget.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F);
}
if(counter % 2 == 0){
ptarget.setFoodLevel(Math.max(0, ptarget.getFoodLevel() - 1));
}
} else {
p.sendMessage(ptarget.getName() + " is a member of your empire, you cannot damage them.");
}
}
else {
target.setHealth(Math.max(0, target.getHealth() - ammo.getYield()));
p.getWorld().playSound(p.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F);
target.getWorld().playSound(target.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F);
}
}
}
loc.add(vec);
}
counter++;
if(counter >= 20) this.cancel();
}
示例9: run
import org.inventivetalent.particle.ParticleEffect; //导入依赖的package包/类
@Override
public void run() {
counter ++;
if (counter < 20) {
if (projectile instanceof Arrow) {
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), projectile.getLocation().getX(), projectile.getLocation().getY(), projectile.getLocation().getZ(), Color.RED);
}
projectile.setVelocity(velocity);
} else {
this.cancel();
projectile.remove();
}
}