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


Java ConfigurationNode.getLong方法代碼示例

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


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

示例1: TimedCase

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public TimedCase(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
        ConfigurationNode delay_node = node.getNode("DELAY");
        if (virtual_name_node.isVirtual()) {
            throw new RuntimeException("VIRTUAL_NAME node does not exist!");
        }
        if (delay_node.isVirtual()) {
            throw new RuntimeException("DELAY node does not exist!");
        }
        virtual_name = virtual_name_node.getString();
        delay = delay_node.getLong();
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Timed Case!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:18,代碼來源:TimedCase.java

示例2: DelayDrop

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public DelayDrop(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode child_drop_node = node.getNode("CHILD_DROP");
        ConfigurationNode delay_node = node.getNode("DELAY");
        if (child_drop_node.isVirtual()) {
            throw new RuntimeException("CHILD_DROP node does not exist!");
        }
        child_drop = (Drop) Utils.createSuperObject(child_drop_node, SuperObjectType.DROP);
        if (delay_node.isVirtual()) {
            throw new RuntimeException("DELAY node does not exist!");
        }
        delay = delay_node.getLong();
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Delay Drop!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:18,代碼來源:DelayDrop.java

示例3: TimedKey

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public TimedKey(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
        ConfigurationNode delay_node = node.getNode("DELAY");
        if (virtual_name_node.isVirtual()) {
            throw new RuntimeException("VIRTUAL_NAME node does not exist!");
        }
        if (delay_node.isVirtual()) {
            throw new RuntimeException("DELAY node does not exist!");
        }
        virtual_name = virtual_name_node.getString();
        delay = delay_node.getLong();
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Timed Key!", e);
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:18,代碼來源:TimedKey.java

示例4: get

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public int get(Player player) {
    ConfigurationNode delay_node = GWMCrates.getInstance().getTimedCasesDelaysConfig().
            getNode(player.getUniqueId().toString(), virtual_name);
    if (delay_node.isVirtual()) {
        return Integer.MAX_VALUE;
    }
    long delay = delay_node.getLong();
    if (System.currentTimeMillis() >= delay) {
        delay_node.setValue(null);
        return Integer.MAX_VALUE;
    } else {
        return 0;
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:16,代碼來源:TimedCase.java

示例5: get

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public int get(Player player) {
    ConfigurationNode delay_node = GWMCrates.getInstance().getTimedKeysDelaysConfig().
            getNode(player.getUniqueId().toString(), virtual_name);
    if (delay_node.isVirtual()) {
        return Integer.MAX_VALUE;
    }
    long delay = delay_node.getLong();
    if (System.currentTimeMillis() >= delay) {
        delay_node.setValue(null);
        return Integer.MAX_VALUE;
    } else {
        return 0;
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:16,代碼來源:TimedKey.java

示例6: Animation1OpenManager

import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public Animation1OpenManager(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode floor_block_type_node = node.getNode("FLOOR_BLOCK_TYPE");
        ConfigurationNode fence_block_type_node = node.getNode("FENCE_BLOCK_TYPE");
        ConfigurationNode crate_block_type_node = node.getNode("CRATE_BLOCK_TYPE");
        ConfigurationNode hologram_node = node.getNode("HOLOGRAM");
        ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
        ConfigurationNode open_manager_node = node.getNode("OPEN_MANAGER");
        if (floor_block_type_node.isVirtual()) {
            throw new RuntimeException("FLOOR_BLOCK_TYPE node does not exist!");
        }
        if (fence_block_type_node.isVirtual()) {
            throw new RuntimeException("FENCE_BLOCK_TYPE node does not exist!");
        }
        if (crate_block_type_node.isVirtual()) {
            throw new RuntimeException("CRATE_BLOCK_TYPE node does not exist!");
        }
        floor_block_type = floor_block_type_node.getValue(TypeToken.of(BlockType.class));
        fence_block_type = fence_block_type_node.getValue(TypeToken.of(BlockType.class));
        crate_block_type = crate_block_type_node.getValue(TypeToken.of(BlockType.class));
        if (!hologram_node.isVirtual()) {
            hologram = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(hologram_node.getString()));
        }
        if (!close_delay_node.isVirtual()) {
            close_delay = close_delay_node.getLong();
        }
        if (!open_manager_node.isVirtual()) {
            open_manager = (OpenManager) Utils.createSuperObject(node, SuperObjectType.OPEN_MANAGER);
        }
    } catch (Exception e) {
        GWMCrates.getInstance().getLogger().info("Exception creating Animation1 Open Manager!");
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:35,代碼來源:Animation1OpenManager.java


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