anonymous No title
No License Java
2020年02月12日
Copy
final int count2 = 900;

                                        BukkitRunnable bukkitRunnable = new BukkitRunnable() {

                                            int anInt = count2;

                                            public void run() {

                                                if (anInt == 0) {

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        Inventory inventory = target.getInventory();

                                                        if (inventory.contains(Material.GOLDEN_APPLE) && inventory.contains(Material.BED) && inventory.contains(Material.LAVA_BUCKET)) {

                                                            String name = target.getName();

                                                            Main.Clear.add(name);

                                                            FireworkEffect effect1 = FireworkEffect.builder().with(FireworkEffect.Type.BURST).withColor(Color.ORANGE)
                                                                    .withFade(Color.WHITE).build();

                                                            FireworkEffect effect2 = FireworkEffect.builder().with(FireworkEffect.Type.BURST).withColor(Color.ORANGE)
                                                                    .withFade(Color.WHITE).build();

                                                            Random rnd = new Random();

                                                            target.sendMessage( Main.prefix + "§fあなたは, §eミッション §fを §6クリア済み §fのため, §bゲームクリア §fです。§6おめでとうございます。");

                                                            target.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 1000000, 0,true, false), true);

                                                            BukkitRunnable runnable = new BukkitRunnable() {

                                                                int i3 = 0;

                                                                @Override
                                                                public void run() {

                                                                    Location location = target.getLocation();

                                                                    if (i3 <= 15) {

                                                                        if (i3 < 15) {

                                                                            Firework firework = location.getWorld().spawn(target.getLocation().clone()
                                                                                    .add(rnd.nextInt(6) - 3, rnd.nextInt(3), rnd.nextInt(6) - 3), Firework.class);
                                                                            FireworkMeta fireworkMeta = firework.getFireworkMeta();
                                                                            fireworkMeta.addEffect(effect1);
                                                                            fireworkMeta.setPower(1);
                                                                            firework.setFireworkMeta(fireworkMeta);

                                                                        } else {

                                                                            Firework firework = location.getWorld().spawn(target.getLocation().clone(), Firework.class);
                                                                            FireworkMeta fireworkMeta = firework.getFireworkMeta();
                                                                            fireworkMeta.addEffect(effect2);
                                                                            fireworkMeta.setPower(1);
                                                                            firework.setFireworkMeta(fireworkMeta);
                                                                        }


                                                                        i3++;

                                                                        return;

                                                                    }

                                                                    cancel();

                                                                }
                                                            };

                                                            runnable.runTaskTimer(Main.getPlugin(), 5, 5);


                                                        } else {

                                                            target.sendMessage( Main.prefix + "§fあなたは, §eミッション §fをクリア §cしていない §fため, §4ゲームオーバー §fです。§6お疲れ様でした。");

                                                        }

                                                        target.playSound(target.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1, 1);
                                                        target.playSound(target.getLocation(), Sound.ENTITY_WITHER_SPAWN, 1, 1);

                                                        target.sendTitle("§b終了", "§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム", 5,20,5);

                                                    }

                                                    Bukkit.broadcastMessage("§b終了");
                                                    Bukkit.broadcastMessage("§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム");

                                                    cancel();

                                                    return;
                                                }


                                                if (anInt <= count2 && anInt>=11) {

                                                    String msg = "§f終了まで残り §b§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 10 && anInt >= 6) {

                                                    String msg = "§f終了まで残り §e§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_SNARE, 1, 1);

                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 5 && anInt >= 4) {

                                                    String msg = "§f終了まで残り §c§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_BASS, 1, 1);


                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 3) {

                                                    String msg = "終了まで残り §c§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_PLING, 1, 1);


                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);

                                                        target.sendTitle("§c" + anInt,  "§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム", 5,20,5);


                                                    }
                                                }

                                                anInt--;

                                            }

                                        };
                                        
                                        bukkitRunnable.runTaskTimer(Main.getPlugin(), 0L, 20L);
final int count2 = 900;

                                        BukkitRunnable bukkitRunnable = new BukkitRunnable() {

                                            int anInt = count2;

                                            public void run() {

                                                if (anInt == 0) {

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        Inventory inventory = target.getInventory();

                                                        if (inventory.contains(Material.GOLDEN_APPLE) && inventory.contains(Material.BED) && inventory.contains(Material.LAVA_BUCKET)) {

                                                            String name = target.getName();

                                                            Main.Clear.add(name);

                                                            FireworkEffect effect1 = FireworkEffect.builder().with(FireworkEffect.Type.BURST).withColor(Color.ORANGE)
                                                                    .withFade(Color.WHITE).build();

                                                            FireworkEffect effect2 = FireworkEffect.builder().with(FireworkEffect.Type.BURST).withColor(Color.ORANGE)
                                                                    .withFade(Color.WHITE).build();

                                                            Random rnd = new Random();

                                                            target.sendMessage( Main.prefix + "§fあなたは, §eミッション §fを §6クリア済み §fのため, §bゲームクリア §fです。§6おめでとうございます。");

                                                            target.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 1000000, 0,true, false), true);

                                                            BukkitRunnable runnable = new BukkitRunnable() {

                                                                int i3 = 0;

                                                                @Override
                                                                public void run() {

                                                                    Location location = target.getLocation();

                                                                    if (i3 <= 15) {

                                                                        if (i3 < 15) {

                                                                            Firework firework = location.getWorld().spawn(target.getLocation().clone()
                                                                                    .add(rnd.nextInt(6) - 3, rnd.nextInt(3), rnd.nextInt(6) - 3), Firework.class);
                                                                            FireworkMeta fireworkMeta = firework.getFireworkMeta();
                                                                            fireworkMeta.addEffect(effect1);
                                                                            fireworkMeta.setPower(1);
                                                                            firework.setFireworkMeta(fireworkMeta);

                                                                        } else {

                                                                            Firework firework = location.getWorld().spawn(target.getLocation().clone(), Firework.class);
                                                                            FireworkMeta fireworkMeta = firework.getFireworkMeta();
                                                                            fireworkMeta.addEffect(effect2);
                                                                            fireworkMeta.setPower(1);
                                                                            firework.setFireworkMeta(fireworkMeta);
                                                                        }


                                                                        i3++;

                                                                        return;

                                                                    }

                                                                    cancel();

                                                                }
                                                            };

                                                            runnable.runTaskTimer(Main.getPlugin(), 5, 5);


                                                        } else {

                                                            target.sendMessage( Main.prefix + "§fあなたは, §eミッション §fをクリア §cしていない §fため, §4ゲームオーバー §fです。§6お疲れ様でした。");

                                                        }

                                                        target.playSound(target.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1, 1);
                                                        target.playSound(target.getLocation(), Sound.ENTITY_WITHER_SPAWN, 1, 1);

                                                        target.sendTitle("§b終了", "§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム", 5,20,5);

                                                    }

                                                    Bukkit.broadcastMessage("§b終了");
                                                    Bukkit.broadcastMessage("§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム");

                                                    cancel();

                                                    return;
                                                }


                                                if (anInt <= count2 && anInt>=11) {

                                                    String msg = "§f終了まで残り §b§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 10 && anInt >= 6) {

                                                    String msg = "§f終了まで残り §e§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_SNARE, 1, 1);

                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 5 && anInt >= 4) {

                                                    String msg = "§f終了まで残り §c§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_BASS, 1, 1);


                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);


                                                    }

                                                } else if (anInt <= 3) {

                                                    String msg = "終了まで残り §c§l" + anInt + "秒§f... ";

                                                    for (Player target : Bukkit.getOnlinePlayers()) {

                                                        target.playSound(target.getLocation(), Sound.BLOCK_NOTE_PLING, 1, 1);


                                                        TextComponent textComponent = new TextComponent();

                                                        textComponent.setText(msg);

                                                        target.spigot().sendMessage(ChatMessageType.ACTION_BAR, textComponent);

                                                        target.sendTitle("§c" + anInt,  "§c1ダメージ§fでも受けたら§4Ban§fされる§cサバイバルゲーム", 5,20,5);


                                                    }
                                                }

                                                anInt--;

                                            }

                                        };
                                        
                                        bukkitRunnable.runTaskTimer(Main.getPlugin(), 0L, 20L);

年末年始は機械学習・深層学習を勉強しませんか?
No one still commented. Please first comment.
年末年始は機械学習・深層学習を勉強しませんか?
広告
未経験から最短でエンジニアへの転職を目指すなら