當前位置: 首頁>>代碼示例>>Java>>正文


Java ConfigurationNode.getInt方法代碼示例

本文整理匯總了Java中ninja.leaping.configurate.ConfigurationNode.getInt方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationNode.getInt方法的具體用法?Java ConfigurationNode.getInt怎麽用?Java ConfigurationNode.getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ninja.leaping.configurate.ConfigurationNode的用法示例。


在下文中一共展示了ConfigurationNode.getInt方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DecorativeItemsChangeMode

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public DecorativeItemsChangeMode(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode change_delay_node = node.getNode("CHANGE_DELAY");
        ConfigurationNode ignored_indices_node = node.getNode("IGNORED_INDICES");
        change_delay = change_delay_node.getInt(10);
        ignored_indices = ignored_indices_node.getList(TypeToken.of(Integer.class), new ArrayList<Integer>());
    } catch (Exception e) {
        throw new RuntimeException("Exception creating First Gui Decorative Items Change Mode!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:12,代碼來源:DecorativeItemsChangeMode.java

示例2: Drop

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public Drop(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode price_node = node.getNode("PRICE");
        ConfigurationNode drop_item_node = node.getNode("DROP_ITEM");
        ConfigurationNode fake_level_node = node.getNode("FAKE_LEVEL");
        ConfigurationNode level_node = node.getNode("LEVEL");
        ConfigurationNode permission_levels_node = node.getNode("PERMISSION_LEVELS");
        ConfigurationNode permission_fake_levels_node = node.getNode("PERMISSION_FAKE_LEVELS");
        if (!price_node.isVirtual()) {
            price = Optional.of(new BigDecimal(price_node.getString("0")));
        }
        if (!drop_item_node.isVirtual()) {
            drop_item = Optional.of(Utils.parseItem(drop_item_node));
        }
        if (!fake_level_node.isVirtual()) {
            fake_level = Optional.of(fake_level_node.getInt(1));
        }
        if (!permission_levels_node.isVirtual()) {
            permission_levels = permission_levels_node.getValue(new TypeToken<Map<String, Integer>>(){});
        }
        if (!permission_fake_levels_node.isVirtual()) {
            permission_fake_levels = permission_fake_levels_node.getValue(new TypeToken<Map<String, Integer>>(){});
        }
        level = level_node.getInt(1);
        if (level < 1) {
            level = 1;
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Drop!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:33,代碼來源:Drop.java

示例3: FirstGuiPreview

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public FirstGuiPreview(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
        ConfigurationNode decorative_items_node = node.getNode("DECORATIVE_ITEMS");
        ConfigurationNode scroll_delay_node = node.getNode("SCROLL_DELAY");
        ConfigurationNode decorative_items_change_mode_node = node.getNode("DECORATIVE_ITEMS_CHANGE_MODE");
        if (!display_name_node.isVirtual()) {
            display_name = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(display_name_node.getString()));
        }
        if (decorative_items_node.isVirtual()) {
            throw new RuntimeException("DECORATIVE_ITEMS node does not exist!");
        }
        decorative_items = new ArrayList<ItemStack>();
        for (ConfigurationNode decorative_item_node : decorative_items_node.getChildrenList()) {
            decorative_items.add(Utils.parseItem(decorative_item_node));
        }
        if (decorative_items.size() != 20) {
            throw new RuntimeException("DECORATIVE_ITEMS size must be 20 instead of " + decorative_items.size() + "!");
        }
        scroll_delay = scroll_delay_node.getInt(10);
        if (!decorative_items_change_mode_node.isVirtual()) {
            decorative_items_change_mode = Optional.of((DecorativeItemsChangeMode) Utils.createSuperObject(decorative_items_change_mode_node, SuperObjectType.DECORATIVE_ITEMS_CHANGE_MODE));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception creating First Gui Preview!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:29,代碼來源:FirstGuiPreview.java

示例4: parseEnchantment

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static Enchantment parseEnchantment(ConfigurationNode node) {
    ConfigurationNode enchantment_node = node.getNode("ENCHANTMENT");
    ConfigurationNode level_node = node.getNode("LEVEL");
    if (enchantment_node.isVirtual()) {
        throw new RuntimeException("ENCHANTMENT node does not exist!");
    }
    try {
        EnchantmentType type = enchantment_node.getValue(TypeToken.of(EnchantmentType.class));
        int level = level_node.getInt(1);
        return Enchantment.of(type, level);
    } catch (Exception e) {
        throw new RuntimeException("Exception parsing enchantment!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:15,代碼來源:Utils.java

示例5: MultipleAmountKey

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public MultipleAmountKey(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode child_key_node = node.getNode("CHILD_KEY");
        ConfigurationNode amount_node = node.getNode("AMOUNT");
        if (child_key_node.isVirtual()) {
            throw new RuntimeException("CHILD_KEY node does not exist!");
        }
        child_key = (Key) Utils.createSuperObject(child_key_node, SuperObjectType.KEY);
        amount = amount_node.getInt(1);
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Multiple Amount Key!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:15,代碼來源:MultipleAmountKey.java

示例6: getMaxNameLength

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getMaxNameLength()
{
    ConfigurationNode maxLengthNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "name", "maxlength");

    int maxLength = maxLengthNode.getInt();

    return maxLength;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例7: getMinNameLength

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getMinNameLength()
{
    ConfigurationNode minLengthNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "name", "minlength");

    int minLength = minLengthNode.getInt();

    return minLength;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例8: getMaxTagLength

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getMaxTagLength()
{
    ConfigurationNode maxLengthNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "tag", "maxlength");

    int maxLength = maxLengthNode.getInt();

    return maxLength;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例9: getMinTagLength

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getMinTagLength()
{
    ConfigurationNode minLengthNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "tag", "minlength");

    int minLength = minLengthNode.getInt();

    return minLength;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例10: getPlayerLimit

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getPlayerLimit()
{
    ConfigurationNode limitNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "playerlimit", "limit");

    int limit = limitNode.getInt();

    return limit;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例11: getAttackTime

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static int getAttackTime()
{
    ConfigurationNode attackTimeNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "gameplay", "attacktime");

    int attackTime = attackTimeNode.getInt();

    return attackTime;
}
 
開發者ID:Aquerr,項目名稱:EagleFactions,代碼行數:9,代碼來源:MainLogic.java

示例12: parseItem

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public static ItemStack parseItem(ConfigurationNode node) {
    try {
        ConfigurationNode item_type_node = node.getNode("ITEM_TYPE");
        ConfigurationNode quantity_node = node.getNode("QUANTITY");
        ConfigurationNode sub_id_node = node.getNode("SUB_ID");
        ConfigurationNode nbt_node = node.getNode("NBT");
        ConfigurationNode durability_node = node.getNode("DURABILITY");
        ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
        ConfigurationNode lore_node = node.getNode("LORE");
        ConfigurationNode enchantments_node = node.getNode("ENCHANTMENTS");
        ConfigurationNode hide_enchantments_node = node.getNode("HIDE_ENCHANTMENTS");
        if (item_type_node.isVirtual()) {
            throw new RuntimeException("ITEM_TYPE node does not exist!");
        }
        //Mega-shit-code start
        ConfigurationNode temp_node = node.getNode("TEMP_SPONGE_ITEM_STACK_NODE");
        temp_node.getNode("ItemType").setValue(item_type_node.getString());
        temp_node.getNode("UnsafeDamage").setValue(sub_id_node.getInt(0));
        temp_node.getNode("Count").setValue(quantity_node.getInt(1));
        ItemStack item = temp_node.getValue(TypeToken.of(ItemStack.class));
        temp_node.setValue(null);
        //Mega-shit-code end; Another not good code start
        if (!nbt_node.isVirtual()) {
            LinkedHashMap nbt_map = (LinkedHashMap) nbt_node.getValue();
            if (item.toContainer().get(DataQuery.of("UnsafeData")).isPresent()) {
                Map unsafe_data_map = item.toContainer().getMap(DataQuery.of("UnsafeData")).get();
                nbt_map.putAll(unsafe_data_map);
            }
            DataContainer container = item.toContainer().set(DataQuery.of("UnsafeData"), nbt_map);
            item = ItemStack.builder().fromContainer(container).build();
        }
        //Another not good code end
        if (!durability_node.isVirtual()) {
            int durability = durability_node.getInt();
            item.offer(Keys.ITEM_DURABILITY, durability);
        }
        if (!display_name_node.isVirtual()) {
            Text display_name = TextSerializers.FORMATTING_CODE.deserialize(display_name_node.getString());
            item.offer(Keys.DISPLAY_NAME, display_name);
        }
        if (!lore_node.isVirtual()) {
            List<Text> lore = lore_node.getList(TypeToken.of(String.class)).stream().
                    map(TextSerializers.FORMATTING_CODE::deserialize).
                    collect(Collectors.toList());
            item.offer(Keys.ITEM_LORE, lore);
        }
        if (!enchantments_node.isVirtual()) {
            List<Enchantment> item_enchantments = new ArrayList<Enchantment>();
            for (ConfigurationNode enchantment_node : enchantments_node.getChildrenList()) {
                item_enchantments.add(parseEnchantment(enchantment_node));
            }
            item.offer(Keys.ITEM_ENCHANTMENTS, item_enchantments);
        }
        if (!hide_enchantments_node.isVirtual()) {
            item.offer(Keys.HIDE_ENCHANTMENTS, hide_enchantments_node.getBoolean());
        }
        return item;
    } catch (Exception e) {
        throw new RuntimeException("Exception parsing item!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:62,代碼來源:Utils.java

示例13: SecondOpenManager

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public SecondOpenManager(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
        ConfigurationNode hidden_item_node = node.getNode("HIDDEN_ITEM");
        ConfigurationNode increase_hidden_item_quantity_node = node.getNode("INCREASE_HIDDEN_ITEM_QUANTITY");
        ConfigurationNode rows_node = node.getNode("ROWS");
        ConfigurationNode show_other_drops_node = node.getNode("SHOW_OTHER_DROPS");
        ConfigurationNode show_other_drops_delay_node = node.getNode("SHOW_OTHER_DROPS_DELAY");
        ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
        ConfigurationNode forbid_close_node = node.getNode("FORBID_CLOSE");
        ConfigurationNode give_random_on_close_node = node.getNode("GIVE_RANDOM_ON_CLOSE");
        ConfigurationNode click_sound_node = node.getNode("CLICK_SOUND");
        if (!display_name_node.isVirtual()) {
            display_name = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(display_name_node.getString()));
        }
        if (hidden_item_node.isVirtual()) {
            throw new RuntimeException("HIDDEN_ITEM node does not exist!");
        }
        hidden_item = Utils.parseItem(hidden_item_node);
        increase_hidden_item_quantity = increase_hidden_item_quantity_node.getBoolean(true);
        rows = rows_node.getInt(3);
        if (rows < 1 || rows > 6) {
            GWMCrates.getInstance().getLogger().info("ROWS value more than 6 or less than 1! Force set it to 3!");
            rows = 3;
        }
        show_other_drops = show_other_drops_node.getBoolean(true);
        show_other_drops_delay = show_other_drops_delay_node.getInt(0);
        close_delay = close_delay_node.getInt(20);
        if (close_delay <= show_other_drops_delay) {
            GWMCrates.getInstance().getLogger().info("SHOW OTHER DROPS DELAY more or equal to CLOSE DELAY! Force set it to 0!");
            show_other_drops_delay = 0;
        }
        forbid_close = forbid_close_node.getBoolean(true);
        give_random_on_close = give_random_on_close_node.getBoolean(true);
        if (!click_sound_node.isVirtual()) {
            click_sound = Optional.of(click_sound_node.getValue(TypeToken.of(SoundType.class)));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Second Gui Open Manager!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:43,代碼來源:SecondOpenManager.java

示例14: FirstOpenManager

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public FirstOpenManager(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
        ConfigurationNode decorative_items_node = node.getNode("DECORATIVE_ITEMS");
        ConfigurationNode scroll_delays_node = node.getNode("SCROLL_DELAYS");
        ConfigurationNode clear_decorative_items_node = node.getNode("CLEAR_DECORATIVE_ITEMS");
        ConfigurationNode clear_other_drops_node = node.getNode("CLEAR_OTHER_DROPS");
        ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
        ConfigurationNode forbid_close_node = node.getNode("FORBID_CLOSE");
        ConfigurationNode scroll_sound_node = node.getNode("SCROLL_SOUND");
        ConfigurationNode win_sound_node = node.getNode("WIN_SOUND");
        ConfigurationNode decorative_items_change_mode_node = node.getNode("DECORATIVE_ITEMS_CHANGE_MODE");
        if (!display_name_node.isVirtual()) {
            display_name = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(display_name_node.getString()));
        }
        if (decorative_items_node.isVirtual()) {
            throw new RuntimeException("DECORATIVE_ITEMS node does not exist!");
        }
        decorative_items = new ArrayList<ItemStack>();
        for (ConfigurationNode decorative_item_node : decorative_items_node.getChildrenList()) {
            decorative_items.add(Utils.parseItem(decorative_item_node));
        }
        if (decorative_items.size() != 20) {
            throw new RuntimeException("DECORATIVE_ITEMS size must be 20 instead of " + decorative_items.size() + "!");
        }
        if (scroll_delays_node.isVirtual()) {
            throw new RuntimeException("SCROLL_DELAYS node does not exist!");
        }
        scroll_delays = scroll_delays_node.getList(TypeToken.of(Integer.class));
        clear_decorative_items = clear_decorative_items_node.getBoolean(false);
        clear_other_drops = clear_other_drops_node.getBoolean(true);
        if (close_delay_node.isVirtual()) {
            throw new RuntimeException("CLOSE_DELAY node does not exist!");
        }
        close_delay = close_delay_node.getInt();
        forbid_close = forbid_close_node.getBoolean(true);
        if (!scroll_sound_node.isVirtual()) {
            scroll_sound = Optional.of(scroll_sound_node.getValue(TypeToken.of(SoundType.class)));
        }
        if (!win_sound_node.isVirtual()) {
            win_sound = Optional.of(win_sound_node.getValue(TypeToken.of(SoundType.class)));
        }
        if (!decorative_items_change_mode_node.isVirtual()) {
            decorative_items_change_mode = Optional.of((DecorativeItemsChangeMode) Utils.createSuperObject(decorative_items_change_mode_node, SuperObjectType.DECORATIVE_ITEMS_CHANGE_MODE));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception creating First Gui Open Manager!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:51,代碼來源:FirstOpenManager.java


注:本文中的ninja.leaping.configurate.ConfigurationNode.getInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。