當前位置: 首頁>>代碼示例>>Java>>正文


Java ParticleEffect類代碼示例

本文整理匯總了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);
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:20,代碼來源:KittyCMD.java

示例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);
}
 
開發者ID:InventivetalentDev,項目名稱:Murder,代碼行數:17,代碼來源:ArenaOutlineTask.java

示例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);
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:30,代碼來源:ExplosiveSheep.java

示例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);
	}
}
 
開發者ID:InventivetalentDev,項目名稱:Murder,代碼行數:11,代碼來源:FootStep.java

示例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);
}
 
開發者ID:InventivetalentDev,項目名稱:Murder,代碼行數:10,代碼來源:KnifeProjectile.java

示例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);
}
 
開發者ID:InventivetalentDev,項目名稱:Murder,代碼行數:8,代碼來源:GunProjectile.java

示例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;
    }
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:54,代碼來源:BossAttacks.java

示例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();
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:54,代碼來源:BeamTurret.java

示例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();
		
	}

}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:23,代碼來源:ProjectileSmoother.java


注:本文中的org.inventivetalent.particle.ParticleEffect類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。