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

Помогите Проверить существование строки в конфиге

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

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

    Fenix78563 Активный участник Пользователь

    Баллы:
    76
    Имя в Minecraft:
    Blc_Dragon
    доброго времени суток, форумчане. вопрос ↑

    Заранее спасибо
     
  2. Хостинг MineCraft
    <
  3. Dereku

    Dereku Старожил

    Баллы:
    173
    Skype:
    derek_unavailable
    Имя в Minecraft:
    _Dereku
    ConfigurationSection#contains(String path) для проверки пути, и ConfigurationSection#isSet(String path) для проверки наличия значения.
     
  4. Автор темы
    Fenix78563

    Fenix78563 Активный участник Пользователь

    Баллы:
    76
    Имя в Minecraft:
    Blc_Dragon
    эклипс материт, говорит что так нельзя.

    Проблему решил массивом и циклом. Спасибо за помощь
     
  5. Dereku

    Dereku Старожил

    Баллы:
    173
    Skype:
    derek_unavailable
    Имя в Minecraft:
    _Dereku
    Включая логику и мышление, можно понять, что я пытался донести.
     
  6. Автор темы
    Fenix78563

    Fenix78563 Активный участник Пользователь

    Баллы:
    76
    Имя в Minecraft:
    Blc_Dragon
    К сожалению, у меня нечего включать :)
     
  7. Dereku

    Dereku Старожил

    Баллы:
    173
    Skype:
    derek_unavailable
    Имя в Minecraft:
    _Dereku
    Дам кусочки из исходников.
    ConfigurationSection.java:
    Код:
        /**
         * Checks if this {@link ConfigurationSection} contains the given path.
         * <p>
         * If the value for the requested path does not exist but a default value
         * has been specified, this will return true.
         *
         * @param path Path to check for existence.
         * @return True if this section contains the requested path, either via
         *     default or being set.
         * @throws IllegalArgumentException Thrown when path is null.
         */
        public boolean contains(String path);
    
        /**
         * Checks if this {@link ConfigurationSection} has a value set for the
         * given path.
         * <p>
         * If the value for the requested path does not exist but a default value
         * has been specified, this will still return false.
         *
         * @param path Path to check for existence.
         * @return True if this section contains the requested path, regardless of
         *     having a default.
         * @throws IllegalArgumentException Thrown when path is null.
         */
        public boolean isSet(String path);
     

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