Effects.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:RPGPlus 作者:
public static void fireBarrier(PlayerInteractEvent event){
    final Player player = (Player) event.getPlayer();
    final Location loc = (Location) player.getLocation();
    new BukkitRunnable() {
        double phi = 0;
        @Override
        public void run() {
            phi += (Math.PI/10);
            for(double theta = 0; theta <= 2*Math.PI; theta += Math.PI/40){
                double r = 1.5;
                double x = r*Math.cos(theta)*Math.sin(phi);
                double y = r* Math.cos(phi) + 1.5;
                double z = r*Math.sin(theta)*Math.sin(phi);
                loc.add(x,y,z);
                ParticleEffect.FLAME.display(0, 0, 0, 3, 3, loc, 40);
                loc.subtract(x,y,z);
                if(theta == 0){
                    ActionBarAPI.sendActionBar(player, Main.colorThis("&c&lFire BARRIER SPELL &7&lACTIVATED")); 

                }
            }
            if(phi > 4*Math.PI){
                this.cancel();
            }

        }
    }.runTaskTimer(Main.getInstance(), 0, 1);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号