//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import java.util.Collection;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;

public class Rocket {
    protected final Player launcher;
    protected final RocketType type;
    protected final Location target;
    protected final RocketPlugin plugin;
    protected Location currentLocation;
    protected double speed = 1.0;

    public Rocket(Player launcher, RocketType type, Location target, RocketPlugin plugin) {
        this.launcher = launcher;
        this.type = type;
        this.target = target;
        this.plugin = plugin;
        this.currentLocation = launcher.getLocation().clone();
    }

    public void launch() {
        final World world = this.launcher.getWorld();
        if (world == null) {
            this.launcher.sendMessage("§cОшибка: Мир не найден.");
        } else {
            world.spawnParticle(this.type.getLaunchParticle(), this.currentLocation, 20, 0.5, 0.5, 0.5, 0.05);
            world.playSound(this.currentLocation, this.type.getLaunchSound(), 1.0F, 1.0F);
            (new BukkitRunnable() {
                public void run() {
                    Vector direction = Rocket.this.target.clone().subtract(Rocket.this.currentLocation).toVector();
                    double distance = direction.length();
                    if (distance < (double)Rocket.this.type.getRange()) {
                        Rocket.this.explode();
                        this.cancel();
                    } else {
                        direction = direction.normalize().multiply(Rocket.this.speed);
                        Rocket.this.currentLocation.add(direction);
                        world.spawnParticle(Rocket.this.type.getLaunchParticle(), Rocket.this.currentLocation, 5, 0.1, 0.1, 0.1, 0.02);
                    }

                }
            }).runTaskTimer(this.plugin, 0L, 1L);
        }
    }

    protected void explode() {
        World world = this.target.getWorld();
        if (world == null) {
            this.launcher.sendMessage("§cОшибка: Целевая локация не найдена.");
        } else {
            if (this.type.isOptimized()) {
                this.optimizedExplode(world);
            } else {
                this.standardExplode(world);
            }

        }
    }

    protected void standardExplode(final World world) {
        world.createExplosion(this.target, (float)this.type.getPower(), false, true);
        world.spawnParticle(this.type.getExplosionParticle(), this.target, 100, 1.0, 1.0, 1.0, 0.1);
        world.playSound(this.target, this.type.getExplosionSound(), 1.0F, 1.0F);
        if (this.type.getName().equalsIgnoreCase("SUPER_NUCLEAR") || this.type.getName().equalsIgnoreCase("MEGA_NUCLEAR") || this.type.getName().equalsIgnoreCase("EXTREME_NUCLEAR") || this.type.getName().equalsIgnoreCase("ULTRA_NUCLEAR") || this.type.getName().equalsIgnoreCase("USSR")) {
            double effectRadius = 20.0;
            Collection<Entity> entities = world.getNearbyEntities(this.target, effectRadius, effectRadius, effectRadius);
            Iterator var5 = entities.iterator();

            while(var5.hasNext()) {
                Entity entity = (Entity)var5.next();
                if (entity instanceof Player) {
                    Player player = (Player)entity;
                    player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 200, 1));
                    player.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 200, 1));
                }
            }

            (new BukkitRunnable() {
                private int ticks = 0;
                private final int maxTicks = 100;

                public void run() {
                    if (this.ticks >= 100) {
                        this.cancel();
                    } else {
                        world.spawnParticle(Particle.EXPLOSION_HUGE, Rocket.this.target, 50, 2.0, 2.0, 2.0, 0.05);
                        world.spawnParticle(Particle.LAVA, Rocket.this.target, 100, 3.0, 3.0, 3.0, 0.02);
                        world.spawnParticle(Particle.FIREWORKS_SPARK, Rocket.this.target, 100, 4.0, 4.0, 4.0, 0.1);
                        world.spawnParticle(Particle.END_ROD, Rocket.this.target, 50, 2.0, 2.0, 2.0, 0.05);
                        world.playSound(Rocket.this.target, Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 1.0F);
                        ++this.ticks;
                    }

                }
            }).runTaskTimer(this.plugin, 0L, 1L);
        }

    }

    protected void optimizedExplode(final World world) {
        world.createExplosion(this.target, (float)this.type.getPower(), false, true);
        world.spawnParticle(this.type.getExplosionParticle(), this.target, 50, 0.5, 0.5, 0.5, 0.02);
        world.playSound(this.target, this.type.getExplosionSound(), 1.0F, 1.0F);
        double effectRadius = (double)(this.type.getRange() / 2);
        Collection<Entity> entities = world.getNearbyEntities(this.target, effectRadius, effectRadius, effectRadius);
        Iterator var5 = entities.iterator();

        while(var5.hasNext()) {
            Entity entity = (Entity)var5.next();
            if (entity instanceof Player player) {
                player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100, 1));
            }
        }

        (new BukkitRunnable() {
            private int ticks = 0;
            private final int maxTicks = 50;

            public void run() {
                if (this.ticks >= 50) {
                    this.cancel();
                } else {
                    world.spawnParticle(Particle.SMOKE_NORMAL, Rocket.this.target, 30, 1.0, 1.0, 1.0, 0.01);
                    world.spawnParticle(Particle.FLAME, Rocket.this.target, 50, 1.0, 1.0, 1.0, 0.02);
                    world.playSound(Rocket.this.target, Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 1.0F);
                    ++this.ticks;
                }

            }
        }).runTaskTimer(this.plugin, 0L, 1L);
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class RocketCommand implements CommandExecutor {
    private final RocketManager rocketManager;
    private final StatsManager statsManager;
    private final RocketPlugin plugin;

    public RocketCommand(RocketManager rocketManager, StatsManager statsManager, RocketPlugin plugin) {
        this.rocketManager = rocketManager;
        this.statsManager = statsManager;
        this.plugin = plugin;
    }

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!sender.hasPermission("rocketplugin.use")) {
            sender.sendMessage(ChatColor.RED + "§cУ вас нет разрешения использовать эту команду.");
            return true;
        } else if (args.length == 0) {
            sender.sendMessage(ChatColor.RED + "§cИспользование: /rocket <launch|give|stats|reload> [параметры]");
            return true;
        } else {
            switch (args[0].toLowerCase()) {
                case "launch" -> this.handleLaunch(sender, args);
                case "give" -> this.handleGive(sender, args);
                case "stats" -> this.handleStats(sender, args);
                case "reload" -> this.handleReload(sender, args);
                default -> sender.sendMessage(ChatColor.RED + "§cНеизвестная подкоманда. Использование: /rocket <launch|give|stats|reload> [параметры]");
            }

            return true;
        }
    }

    private void handleLaunch(CommandSender sender, String[] args) {
        if (sender instanceof Player player) {
            if (args.length < 5) {
                player.sendMessage(ChatColor.RED + "§cИспользование: /rocket launch <type> <x> <y> <z> [delay]");
                player.sendMessage(ChatColor.YELLOW + "§eПримечание: delay - опциональный параметр (1-30 секунд)");
            } else {
                String typeName = args[1].toUpperCase();
                RocketType type = this.rocketManager.getRocketType(typeName);
                if (type == null) {
                    player.sendMessage(ChatColor.RED + "§cНеверный тип ракеты. Используйте /rocket для просмотра доступных типов.");
                } else {
                    double x;
                    double y;
                    double z;
                    try {
                        x = Double.parseDouble(args[2]);
                        y = Double.parseDouble(args[3]);
                        z = Double.parseDouble(args[4]);
                    } catch (NumberFormatException var15) {
                        player.sendMessage(ChatColor.RED + "§cКоординаты должны быть действительными числами.");
                        return;
                    }

                    Location target = new Location(player.getWorld(), x, y, z);
                    int delay = 0;
                    if (args.length >= 6) {
                        try {
                            delay = Integer.parseInt(args[5]);
                            if (delay < 1 || delay > 30) {
                                player.sendMessage(ChatColor.RED + "§cЗадержка должна быть между 1 и 30 секундами.");
                                return;
                            }
                        } catch (NumberFormatException var16) {
                            player.sendMessage(ChatColor.RED + "§cЗадержка должна быть целым числом.");
                            return;
                        }
                    }

                    this.rocketManager.launchRocket(player, type, target, delay);
                }
            }
        } else {
            sender.sendMessage(ChatColor.RED + "§cТолько игроки могут запускать ракеты.");
        }
    }

    private void handleGive(CommandSender sender, String[] args) {
        if (!sender.hasPermission("rocketplugin.give")) {
            sender.sendMessage(ChatColor.RED + "§cУ вас нет разрешения выдавать ракеты.");
        } else if (args.length < 4) {
            sender.sendMessage(ChatColor.RED + "§cИспользование: /rocket give <player> <type> <amount>");
        } else {
            String targetName = args[1];
            Player targetPlayer = Bukkit.getPlayerExact(targetName);
            if (targetPlayer == null) {
                sender.sendMessage(ChatColor.RED + "§cИгрок не найден или не онлайн.");
            } else {
                String typeName = args[2].toUpperCase();
                RocketType type = this.rocketManager.getRocketType(typeName);
                if (type == null) {
                    sender.sendMessage(ChatColor.RED + "§cНеверный тип ракеты. Используйте /rocket для просмотра доступных типов.");
                } else {
                    int amount;
                    try {
                        amount = Integer.parseInt(args[3]);
                        if (amount <= 0) {
                            throw new NumberFormatException();
                        }
                    } catch (NumberFormatException var9) {
                        sender.sendMessage(ChatColor.RED + "§cКоличество должно быть положительным целым числом.");
                        return;
                    }

                    this.statsManager.addRockets(targetPlayer, type, amount);
                    ChatColor var10001 = ChatColor.GREEN;
                    sender.sendMessage("" + var10001 + "§aВыдали " + amount + " ракет типа " + type.getName() + " игроку " + targetPlayer.getName() + ".");
                    var10001 = ChatColor.GREEN;
                    targetPlayer.sendMessage("" + var10001 + "§aВам выдали " + amount + " ракет типа " + type.getName() + " от " + sender.getName() + ".");
                }
            }
        }
    }

    private void handleStats(CommandSender sender, String[] args) {
        if (args.length < 2) {
            if (sender instanceof Player) {
                Player player = (Player)sender;
                sender.sendMessage(this.statsManager.getStats(player));
            } else {
                sender.sendMessage(ChatColor.RED + "§cКонсоль не имеет статистики.");
            }

        } else {
            String targetName = args[1];
            Player targetPlayer = Bukkit.getPlayerExact(targetName);
            if (targetPlayer == null) {
                sender.sendMessage(ChatColor.RED + "§cИгрок не найден или не онлайн.");
            } else {
                sender.sendMessage(this.statsManager.getStats(targetPlayer));
            }
        }
    }

    private void handleReload(CommandSender sender, String[] args) {
        if (!sender.hasPermission("rocketplugin.reload")) {
            sender.sendMessage(ChatColor.RED + "§cУ вас нет разрешения перезагружать конфигурацию.");
        } else {
            this.plugin.reloadConfig();
            this.rocketManager.loadRocketTypes();
            sender.sendMessage(ChatColor.GREEN + "§aКонфигурация плагина успешно перезагружена.");
        }
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import java.util.Iterator;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;

public class RocketListener implements Listener {
    private final RocketManager rocketManager;
    private final RocketPlugin plugin;

    public RocketListener(RocketManager rocketManager, RocketPlugin plugin) {
        this.rocketManager = rocketManager;
        this.plugin = plugin;
    }

    @EventHandler
    public void onExplosionPrime(ExplosionPrimeEvent event) {
        World world = event.getEntity().getWorld();
        if (!world.getName().equalsIgnoreCase("P_Drilla")) {
            event.setCancelled(true);
            Entity var4 = event.getEntity();
            if (var4 instanceof Player) {
                Player player = (Player)var4;
                player.sendMessage(ChatColor.RED + "§cВзрывы вне мира запрещены!");
            }
        }

    }

    @EventHandler
    public void onEntityExplode(EntityExplodeEvent event) {
        World world = event.getEntity().getWorld();
        if (!world.getName().equalsIgnoreCase("P_Drilla")) {
            event.setCancelled(true);
        } else {
            Location explosionLocation = event.getLocation();
            double radius = 10.0;
            List<PVOBlock> nearbyPVO = this.rocketManager.getPvoManager().getPVOBlocksInRadius(explosionLocation, radius);
            if (!nearbyPVO.isEmpty()) {
                Iterator var7 = nearbyPVO.iterator();

                while(true) {
                    PVOBlock block;
                    Player owner;
                    do {
                        if (!var7.hasNext()) {
                            return;
                        }

                        block = (PVOBlock)var7.next();
                        owner = this.plugin.getServer().getPlayer(block.getLocation().getWorld().getName());
                    } while(owner == null);

                    List<Player> affectedPlayers = world.getPlayers();
                    Iterator var11 = affectedPlayers.iterator();

                    while(var11.hasNext()) {
                        Player p = (Player)var11.next();
                        if (!p.equals(owner) && !block.getExcludedPlayers().contains(p.getUniqueId())) {
                            event.setCancelled(true);
                            p.sendMessage(ChatColor.RED + "§cВаш ПВО блок предотвратил взрыв!");
                        }
                    }
                }
            }
        }
    }

    @EventHandler
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
        Entity var3 = event.getEntity();
        if (var3 instanceof Player damaged) {
            Location damageLocation = damaged.getLocation();
            double radius = 10.0;
            List nearbyPVO = this.rocketManager.getPvoManager().getPVOBlocksInRadius(damageLocation, radius);
            if (!nearbyPVO.isEmpty()) {
                Iterator var7 = nearbyPVO.iterator();

                while(var7.hasNext()) {
                    PVOBlock block = (PVOBlock)var7.next();
                    Player owner = this.plugin.getServer().getPlayer(block.getLocation().getWorld().getName());
                    if (owner != null && !block.getExcludedPlayers().contains(damaged.getUniqueId()) && !damaged.equals(owner)) {
                        event.setCancelled(true);
                        damaged.sendMessage(ChatColor.YELLOW + "§eВаш ПВО блок защитил вас от урона!");
                        break;
                    }
                }
            }

        }
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

public class RocketManager {
    private final RocketPlugin plugin;
    private StatsManager statsManager;
    private PVOManager pvoManager;
    private final Random random;
    private final Map<String, RocketType> rocketTypes;

    public RocketManager(RocketPlugin plugin) {
        this.plugin = plugin;
        this.random = new Random();
        this.rocketTypes = new HashMap();
        this.loadRocketTypes();
        this.pvoManager = new PVOManager(plugin);
    }

    public void setStatsManager(StatsManager statsManager) {
        this.statsManager = statsManager;
        this.pvoManager.setStatsManager(statsManager);
    }

    public PVOManager getPvoManager() {
        return this.pvoManager;
    }

    public void loadRocketTypes() {
        FileConfiguration config = this.plugin.getConfig();
        ConfigurationSection rocketsSection = config.getConfigurationSection("rockets");
        if (rocketsSection == null) {
            this.plugin.getLogger().severe("§cРаздел 'rockets' не найден в config.yml! Плагин отключен.");
            this.plugin.getServer().getPluginManager().disablePlugin(this.plugin);
        } else {
            Iterator var3 = rocketsSection.getKeys(false).iterator();

            while(var3.hasNext()) {
                String key = (String)var3.next();
                ConfigurationSection rocketSection = rocketsSection.getConfigurationSection(key);
                if (rocketSection != null) {
                    double power = rocketSection.getDouble("power");
                    int range = rocketSection.getInt("range");
                    String launchParticleStr = rocketSection.getString("launchParticle", "FLAME");
                    String launchSoundStr = rocketSection.getString("launchSound", "ENTITY_FIREWORK_ROCKET_LAUNCH");
                    String explosionSoundStr = rocketSection.getString("explosionSound", "ENTITY_FIREWORK_ROCKET_LAUNCH");
                    String explosionParticleStr = rocketSection.getString("explosionParticle", "SMOKE_NORMAL");
                    int successChance = rocketSection.getInt("successChance", 50);
                    boolean optimized = rocketSection.getBoolean("optimized", false);

                    Particle launchParticle;
                    try {
                        launchParticle = Particle.valueOf(launchParticleStr);
                    } catch (IllegalArgumentException var23) {
                        this.plugin.getLogger().warning("§cНеизвестный тип частицы запуска '" + launchParticleStr + "' для ракеты '" + key + "'. Используется FLAME.");
                        launchParticle = Particle.FLAME;
                    }

                    Sound launchSound;
                    try {
                        launchSound = Sound.valueOf(launchSoundStr);
                    } catch (IllegalArgumentException var22) {
                        this.plugin.getLogger().warning("§cНеизвестный звук запуска '" + launchSoundStr + "' для ракеты '" + key + "'. Используется ENTITY_FIREWORK_ROCKET_LAUNCH.");
                        launchSound = Sound.ENTITY_FIREWORK_ROCKET_LAUNCH;
                    }

                    Sound explosionSound;
                    try {
                        explosionSound = Sound.valueOf(explosionSoundStr);
                    } catch (IllegalArgumentException var21) {
                        this.plugin.getLogger().warning("§cНеизвестный звук взрыва '" + explosionSoundStr + "' для ракеты '" + key + "'. Используется ENTITY_FIREWORK_ROCKET_LAUNCH.");
                        explosionSound = Sound.ENTITY_FIREWORK_ROCKET_LAUNCH;
                    }

                    Particle explosionParticle;
                    try {
                        explosionParticle = Particle.valueOf(explosionParticleStr);
                    } catch (IllegalArgumentException var20) {
                        this.plugin.getLogger().warning("§cНеизвестный тип частицы взрыва '" + explosionParticleStr + "' для ракеты '" + key + "'. Используется SMOKE_NORMAL.");
                        explosionParticle = Particle.SMOKE_NORMAL;
                    }

                    RocketType rocketType = new RocketType(key, power, range, launchParticle, launchSound, explosionSound, explosionParticle, successChance, optimized);
                    this.rocketTypes.put(key.toUpperCase(), rocketType);
                }
            }

            this.plugin.getLogger().info("§aЗагружено " + this.rocketTypes.size() + " типов ракет.");
        }
    }

    public RocketType getRocketType(String name) {
        return (RocketType)this.rocketTypes.get(name.toUpperCase());
    }

    public Map<String, RocketType> getAllRocketTypes() {
        return this.rocketTypes;
    }

    public void launchRocket(final Player player, final RocketType type, final Location target, final int delay) {
        if (!target.getWorld().getName().equalsIgnoreCase("P_Drilla")) {
            player.sendMessage("§cРакеты могут взрываться только в мире P_Drilla.");
        } else if (!this.statsManager.hasRockets(player, type)) {
            player.sendMessage("§cУ вас нет ракет типа " + type.getName() + "!");
        } else {
            this.statsManager.useRocket(player, type);
            if (delay > 0) {
                player.sendMessage("§eЗапуск ракеты через " + delay + " секунд(ы).");
                (new BukkitRunnable() {
                    private int secondsLeft = delay;

                    public void run() {
                        if (this.secondsLeft <= 0) {
                            this.cancel();
                            boolean success = RocketManager.this.checkLaunchSuccess(type);
                            if (success) {
                                Rocket rocket = type.isOptimized() ? new OptimizedRocket(player, type, target, RocketManager.this.plugin) : new Rocket(player, type, target, RocketManager.this.plugin);
                                ((Rocket)rocket).launch();
                                player.sendMessage("§aРакета успешно запущена!");
                            } else {
                                player.sendMessage("§cРакета не смогла достичь цели и не взорвалась.");
                            }
                        } else {
                            player.sendMessage("§eЗапуск ракеты через " + this.secondsLeft + " секунд(ы).");
                            --this.secondsLeft;
                        }

                    }
                }).runTaskTimer(this.plugin, 0L, 20L);
            } else {
                boolean success = this.checkLaunchSuccess(type);
                if (success) {
                    Rocket rocket = type.isOptimized() ? new OptimizedRocket(player, type, target, this.plugin) : new Rocket(player, type, target, this.plugin);
                    ((Rocket)rocket).launch();
                    player.sendMessage("§aРакета успешно запущена!");
                } else {
                    player.sendMessage("§cРакета не смогла достичь цели и не взорвалась.");
                }
            }

        }
    }

    private boolean checkLaunchSuccess(RocketType type) {
        int chance = type.getSuccessChance();
        int roll = this.random.nextInt(100) + 1;
        return roll <= chance;
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;

public class RocketTabCompleter implements TabCompleter {
    private final RocketPlugin plugin;

    public RocketTabCompleter(RocketPlugin plugin) {
        this.plugin = plugin;
    }

    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        if (!command.getName().equalsIgnoreCase("rocket")) {
            return null;
        } else {
            List<String> completions = new ArrayList();
            if (args.length == 1) {
                List<String> subcommands = List.of("launch", "give", "stats", "reload");
                Iterator var15 = subcommands.iterator();

                while(var15.hasNext()) {
                    String sub = (String)var15.next();
                    if (sub.startsWith(args[0].toLowerCase())) {
                        completions.add(sub);
                    }
                }

                return completions;
            } else {
                Map types;
                Iterator var9;
                RocketType type;
                if (args.length != 2) {
                    String amount;
                    if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
                        RocketManager rocketManager = this.plugin.getRocketManager();
                        amount = args[2].toUpperCase();
                        types = rocketManager.getAllRocketTypes();
                        var9 = types.values().iterator();

                        while(var9.hasNext()) {
                            type = (RocketType)var9.next();
                            if (type.getName().toLowerCase().startsWith(amount.toLowerCase())) {
                                completions.add(type.getName());
                            }
                        }

                        return completions;
                    } else if (args.length == 4 && args[0].equalsIgnoreCase("give")) {
                        for(int i = 1; i <= 64; ++i) {
                            amount = String.valueOf(i);
                            if (amount.startsWith(args[3])) {
                                completions.add(amount);
                            }
                        }

                        return completions;
                    } else {
                        if (args.length == 2 && args[0].equalsIgnoreCase("reload")) {
                        }

                        return completions;
                    }
                } else {
                    String subcommand = args[0].toLowerCase();
                    RocketManager rocketManager = this.plugin.getRocketManager();
                    if (!subcommand.equals("launch") && !subcommand.equals("give")) {
                        if (subcommand.equals("stats")) {
                            Iterator var16 = Bukkit.getOnlinePlayers().iterator();

                            while(var16.hasNext()) {
                                Player player = (Player)var16.next();
                                if (player.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
                                    completions.add(player.getName());
                                }
                            }
                        } else if (subcommand.equals("reload")) {
                        }
                    } else {
                        types = rocketManager.getAllRocketTypes();
                        var9 = types.values().iterator();

                        while(var9.hasNext()) {
                            type = (RocketType)var9.next();
                            if (type.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
                                completions.add(type.getName());
                            }
                        }
                    }

                    return completions;
                }
            }
        }
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import org.bukkit.Particle;
import org.bukkit.Sound;

public class RocketType {
    private final String name;
    private final double power;
    private final int range;
    private final Particle launchParticle;
    private final Sound launchSound;
    private final Sound explosionSound;
    private final Particle explosionParticle;
    private final int successChance;
    private final boolean optimized;

    public RocketType(String name, double power, int range, Particle launchParticle, Sound launchSound, Sound explosionSound, Particle explosionParticle, int successChance, boolean optimized) {
        this.name = name;
        this.power = power;
        this.range = range;
        this.launchParticle = launchParticle;
        this.launchSound = launchSound;
        this.explosionSound = explosionSound;
        this.explosionParticle = explosionParticle;
        this.successChance = successChance;
        this.optimized = optimized;
    }

    public String getName() {
        return this.name;
    }

    public double getPower() {
        return this.power;
    }

    public int getRange() {
        return this.range;
    }

    public Particle getLaunchParticle() {
        return this.launchParticle;
    }

    public Sound getLaunchSound() {
        return this.launchSound;
    }

    public Sound getExplosionSound() {
        return this.explosionSound;
    }

    public Particle getExplosionParticle() {
        return this.explosionParticle;
    }

    public int getSuccessChance() {
        return this.successChance;
    }

    public boolean isOptimized() {
        return this.optimized;
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;

public class StatsManager {
    private final RocketPlugin plugin;
    private final File statsFile;
    private FileConfiguration statsConfig;
    private final RocketManager rocketManager;

    public StatsManager(RocketPlugin plugin, RocketManager rocketManager) {
        this.plugin = plugin;
        this.rocketManager = rocketManager;
        this.statsFile = new File(plugin.getDataFolder(), "stats.yml");
        if (!this.statsFile.exists()) {
            try {
                if (plugin.getResource("stats.yml") != null) {
                    plugin.saveResource("stats.yml", false);
                } else {
                    this.statsConfig = new YamlConfiguration();
                    this.statsConfig.save(this.statsFile);
                }
            } catch (IOException var4) {
                IOException e = var4;
                plugin.getLogger().severe("§cНе удалось создать stats.yml:");
                e.printStackTrace();
            }
        }

        this.statsConfig = YamlConfiguration.loadConfiguration(this.statsFile);
    }

    public void load() {
        try {
            this.statsConfig.load(this.statsFile);
        } catch (Exception var2) {
            Exception e = var2;
            this.plugin.getLogger().severe("§cНе удалось загрузить stats.yml:");
            e.printStackTrace();
        }

    }

    public void save() {
        try {
            this.statsConfig.save(this.statsFile);
        } catch (IOException var2) {
            IOException e = var2;
            this.plugin.getLogger().severe("§cНе удалось сохранить stats.yml:");
            e.printStackTrace();
        }

    }

    public int getRockets(Player player, RocketType type) {
        String var10000 = player.getUniqueId().toString();
        String path = var10000 + ".rockets." + type.getName();
        return this.statsConfig.getInt(path, 0);
    }

    public void addRockets(Player player, RocketType type, int amount) {
        String var10000 = player.getUniqueId().toString();
        String path = var10000 + ".rockets." + type.getName();
        int current = this.getRockets(player, type);
        this.statsConfig.set(path, current + amount);
        this.save();
    }

    public boolean hasRockets(Player player, RocketType type) {
        return this.getRockets(player, type) > 0;
    }

    public void useRocket(Player player, RocketType type) {
        String var10000 = player.getUniqueId().toString();
        String path = var10000 + ".rockets." + type.getName();
        int current = this.getRockets(player, type);
        if (current > 0) {
            this.statsConfig.set(path, current - 1);
            this.save();
        }

    }

    public String getStats(Player player) {
        StringBuilder sb = new StringBuilder("§a§lСтатистика Ракет для " + player.getName() + ":\n");
        Map<String, RocketType> allTypes = this.rocketManager.getAllRocketTypes();
        Iterator var4 = allTypes.values().iterator();

        while(var4.hasNext()) {
            RocketType type = (RocketType)var4.next();
            sb.append("§e").append(type.getName()).append(": §b").append(this.getRockets(player, type)).append("\n");
        }

        return sb.toString();
    }
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yourname.rocketplugin;

import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class RocketPlugin extends JavaPlugin {
    private static RocketPlugin instance;
    private RocketManager rocketManager;
    private StatsManager statsManager;
    private PVOManager pvoManager;

    public RocketPlugin() {
    }

    public static RocketPlugin getInstance() {
        return instance;
    }

    public RocketManager getRocketManager() {
        return this.rocketManager;
    }

    public StatsManager getStatsManager() {
        return this.statsManager;
    }

    public PVOManager getPvoManager() {
        return this.pvoManager;
    }

    public void onEnable() {
        instance = this;
        this.saveDefaultConfig();
        this.rocketManager = new RocketManager(this);
        this.statsManager = new StatsManager(this, this.rocketManager);
        this.rocketManager.setStatsManager(this.statsManager);
        this.pvoManager = this.rocketManager.getPvoManager();
        this.statsManager.load();
        PluginCommand rocketCommand = this.getCommand("rocket");
        PluginCommand pvoCommand = this.getCommand("pvo");
        if (rocketCommand != null) {
            rocketCommand.setExecutor(new RocketCommand(this.rocketManager, this.statsManager, this));
            rocketCommand.setTabCompleter(new RocketTabCompleter(this));
            if (pvoCommand != null) {
                pvoCommand.setExecutor(new PVOCommand(this.rocketManager, this));
                PluginManager pm = this.getServer().getPluginManager();
                pm.registerEvents(new RocketListener(this.rocketManager, this), this);
                pm.registerEvents(new PVOListener(this.rocketManager, this), this);
                this.getLogger().info("§aRocketPlugin был включен!");
            } else {
                this.getLogger().severe("§cНе удалось зарегистрировать команду 'pvo'. Проверьте plugin.yml.");
                this.setEnabled(false);
            }
        } else {
            this.getLogger().severe("§cНе удалось зарегистрировать команду 'rocket'. Проверьте plugin.yml.");
            this.setEnabled(false);
        }
    }

    public void onDisable() {
        if (this.statsManager != null) {
            this.statsManager.save();
        }

        if (this.pvoManager != null) {
            this.pvoManager.savePVOBlocks();
        }

        this.getLogger().info("§cRocketPlugin был отключен!");
    }
}
rockets:
  SMALL:
    power: 10.0
    range: 100
    launchParticle: FLAME
    launchSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionParticle: SMOKE_NORMAL
    successChance: 75
    optimized: false
  MEDIUM:
    power: 15.0
    range: 150
    launchParticle: FLAME
    launchSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionParticle: SMOKE_NORMAL
    successChance: 50
    optimized: false
  LARGE:
    power: 25.0
    range: 200
    launchParticle: EXPLOSION_NORMAL
    launchSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionParticle: SMOKE_LARGE
    successChance: 50
    optimized: false
  EXTRA_LARGE:
    power: 35.0
    range: 300
    launchParticle: EXPLOSION_LARGE
    launchSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionSound: ENTITY_FIREWORK_ROCKET_LAUNCH
    explosionParticle: EXPLOSION_HUGE
    successChance: 50
    optimized: false
  NUCLEAR:
    power: 65.0
    range: 500
    launchParticle: EXPLOSION_HUGE
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 40
    optimized: false
  SUPER_NUCLEAR:
    power: 80.0
    range: 700
    launchParticle: EXPLOSION_HUGE
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 30
    optimized: false
  MEGA_NUCLEAR:
    power: 120.0
    range: 1000
    launchParticle: EXPLOSION_HUGE
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 20
    optimized: false
  EXTREME_NUCLEAR:
    power: 190.0
    range: 1500
    launchParticle: SUSPENDED
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 15
    optimized: true
  ULTRA_NUCLEAR:
    power: 270.0
    range: 2000
    launchParticle: SPELL_INSTANT
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 15
    optimized: true
  USSR:
    power: 350.0
    range: 2500
    launchParticle: PORTAL
    launchSound: ENTITY_GENERIC_EXPLODE
    explosionSound: ENTITY_GENERIC_EXPLODE
    explosionParticle: EXPLOSION_HUGE
    successChance: 10
    optimized: false
name: RocketPlugin
version: 1.0
main: com.yourname.rocketplugin.RocketPlugin
api-version: 1.16

commands:
  rocket:
    description: Управление ракетами.
    usage: /rocket <launch|give|trade|remove|stats|reload|craft>
    aliases: [rk]

permissions:
  rocketplugin.use:
    description: Разрешение на использование команд RocketPlugin.
    default: true
  rocketplugin.give:
    description: Разрешение на выдачу ракет другим игрокам.
    default: op
  rocketplugin.trade:
    description: Разрешение на торговлю ракетами между игроками.
    default: op
  rocketplugin.remove:
    description: Разрешение на удаление ракет у игроков.
    default: op
  rocketplugin.reload:
    description: Разрешение на перезагрузку конфигурации плагина.
    default: op
  rocketplugin.craft:
    description: Разрешение на крафт ракет.
    default: false

1) Реализуй все функции для всех команд, убери то, что не нужно (пво, крафт ракет и тд).
2) Реализуй новый метод взрыва ракет, с помощью другой обработки, например с помощью worldedit
3) Сделай ограничение на кол-во ракет. Изначально 0, чтобы появилось, игроку нужно поставить особый блок (для него команду получения), он его ставит и он добавляет 1 ракету (то есть всего 1 из всех типов). Если этот блок разрушается (он не выпадает ввиде блока, а также его нельзя никак скопировать), то отнимается кол-во ракет возможных (если таких 0, то запуск не возможен)