本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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!");
}
}