Хостинг серверов Minecraft playvds.com
  1. Вы находитесь в русском сообществе Bukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на русский язык плагины наших собратьев из других стран.
    Скрыть объявление

Помогите помогите починить плагин

Тема в разделе "Разработка плагинов для новичков", создана пользователем Denary, 28 ноя 2020.

  1. Автор темы
    Denary

    Denary Новичок

    Баллы:
    6
    Имя в Minecraft:
    DenaryPlanet449
    я скачал плагин, но когда я ломаю блоки он выдает такую ошибку:
    Код:
    [00:26:15 ERROR]: Could not pass event BlockBreakEvent to UltraSkyBlock-Core v3.3.4
    java.lang.NullPointerException: null
            at io.github.Leonardo0013YT.UltraSkills.listeners.SkillsListener.onBreak(SkillsListener.java:77) ~[?:?]
            at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor585.execute(Unknown Source) ~[?:?]
            at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PlayerInteractManager.breakBlock(PlayerInteractManager.java:357) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PlayerInteractManager.a(PlayerInteractManager.java:310) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PlayerInteractManager.a(PlayerInteractManager.java:194) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1490) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PacketPlayInBlockDig.a(SourceFile:40) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PacketPlayInBlockDig.a(SourceFile:10) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:43) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:151) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:114) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1205) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1198) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:125) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1174) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1018) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:179) ~[patched_1.16.4.jar:git-Yatopia-"8fbaee0"]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
    кусок кода где происходит ошибка (весь не влез)
    Код:
        public void onBreak(final BlockBreakEvent e) {
            if (e.isCancelled()) {
                return;
            }
            final Player p = e.getPlayer();
            final Block b = e.getBlock();
            if (this.plugin.getDm().getAltars().contains(b.getLocation()) || this.plugin.getSlm().isFairySoul(b.getLocation())) {
                e.setCancelled(true);
                return;
            }
            if (this.plugin.getSkm().isCache(b.getLocation())) {
                this.plugin.getSkm().removeCache(b.getLocation());
                return;
            }
            if (!this.plugin.getAdm().checkMember(p)) {
                return;
            }
            final DataPlayer pd = this.plugin.getDb().getPlayerData(p);
            final IPlayerIsland pi = pd.getDefault();
            final Location l = b.getLocation();
            final boolean mine = this.plugin.getMm().isMineLocation(l);
            if (this.isLog(b.getType())) {
                if (!this.isEnabledWorld(p, SkillType.FORAGING)) {
                    return;
                }
                if (this.plugin.getAdm().isProtection(p, b.getLocation(), SkillType.FORAGING) && !mine) {
                    return;
                }
                final SkillData sd = this.plugin.getSkm().getSkillData(SkillType.FORAGING, b.getType().name());
                if (sd != null) {
                    pi.addSkillProgress("FORAGING", sd.getXp());
                    final int random = ThreadLocalRandom.current().nextInt(0, 1000);
                    final double amount = pi.getDoubleLogs() * 10;
                    if (random <= amount) {
                        for (final ItemStack i : b.getDrops()) {
                            if (i != null) {
                                if (i.getType().equals((Object)Material.AIR)) {
                                    continue;
                                }
                                l.getWorld().dropItemNaturally(l, i);
                            }
                        }
                    }
                    this.plugin.getTsm().sendProgress(p, SkillType.FORAGING, pd, sd.getXp());
                    this.plugin.getCfm().getProgress().reproduce(p);
                    this.addPetXP(p, pd, pi, sd.getXp());
                }
            }
            if (this.isSugarPumpkinMelon(b.getType()) || (this.isCrop(b.getType()) && XBlock.isMax(b))) {
                if (!this.isEnabledWorld(p, SkillType.FARMER)) {
                    return;
                }
                if (this.plugin.getAdm().isProtection(p, b.getLocation(), SkillType.FARMER) && !mine) {
                    return;
                }
                final SkillData sd = this.plugin.getSkm().getSkillData(SkillType.FARMER, b.getType().name());
                if (sd != null) {
                    pi.addSkillProgress("FARMER", sd.getXp());
                    final int random = ThreadLocalRandom.current().nextInt(0, 1000);
                    final double amount = pi.getDoubleCrops() * 10;
                    if (random <= amount) {
                        for (final ItemStack i : b.getDrops()) {
                            if (i != null) {
                                if (i.getType().equals((Object)Material.AIR)) {
                                    continue;
                                }
                                l.getWorld().dropItemNaturally(l, i);
                            }
                        }
                    }
                    this.plugin.getTsm().sendProgress(p, SkillType.FARMER, pd, sd.getXp());
                    this.plugin.getCfm().getProgress().reproduce(p);
                    this.addPetXP(p, pd, pi, sd.getXp());
                }
            }
            if (this.isOre(b.getType())) {
                final SkillData sd = this.plugin.getSkm().getSkillData(SkillType.MINER, b.getType().name());
                if (sd != null) {
                    if (!this.isEnabledWorld(p, SkillType.MINER)) {
                        return;
                    }
                    if (this.plugin.getAdm().isProtection(p, b.getLocation(), SkillType.MINER) && !mine) {
                        return;
                    }
                    pi.addSkillProgress("MINER", sd.getXp());
                    final int random = ThreadLocalRandom.current().nextInt(0, 1000);
                    final double amount = pi.getDoubleOres() * 10;
                    if (random <= amount) {
                        for (final ItemStack i : b.getDrops()) {
                            if (i != null) {
                                if (i.getType().equals((Object)Material.AIR)) {
                                    continue;
                                }
                                l.getWorld().dropItemNaturally(l, i);
                            }
                        }
                    }
                    this.plugin.getTsm().sendProgress(p, SkillType.MINER, pd, sd.getXp());
                    this.plugin.getCfm().getProgress().reproduce(p);
                    this.addPetXP(p, pd, pi, sd.getXp());
                }
            }
            if (mine) {
                final Mine m = this.plugin.getMm().getMineLocation(l);
                Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin)this.plugin, () -> b.getLocation().getBlock().setType(m.getBreaking()), 1L);
                this.plugin.getMm().addMineCountdown(l, m.getKey(), m.getCountdown());
            }
        }
     
  2. Хостинг MineCraft
    <

Поделиться этой страницей