当前位置: 首页>>代码示例>>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;未经允许,请勿转载。