当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationNode.isVirtual方法代码示例

本文整理汇总了Java中ninja.leaping.configurate.ConfigurationNode.isVirtual方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationNode.isVirtual方法的具体用法?Java ConfigurationNode.isVirtual怎么用?Java ConfigurationNode.isVirtual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ninja.leaping.configurate.ConfigurationNode的用法示例。


在下文中一共展示了ConfigurationNode.isVirtual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
    try {
        ConfigurationNode node = getNode();
        ConfigurationNode permission_node = node.getNode("PERMISSION");
        ConfigurationNode drop1_node = node.getNode("DROP1");
        ConfigurationNode drop2_node = node.getNode("DROP2");
        if (!permission_node.isVirtual()) {
            permission_field.setText(permission_node.getString());
        }
        if (!drop1_node.isVirtual()) {
            drop1_panel.setNode(drop1_node);
        }
        if (!drop2_node.isVirtual()) {
            drop2_panel.setNode(drop2_node);
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception loading Permission Drop Configuration Dialog!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:20,代码来源:PermissionDropConfigurationDialog.java

示例2: BlockCase

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public BlockCase(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode location_node = node.getNode("LOCATION");
        ConfigurationNode hologram_node = node.getNode("HOLOGRAM");
        ConfigurationNode start_preview_on_left_click_node = node.getNode("START_PREVIEW_ON_LEFT_CLICK");
        if (location_node.isVirtual()) {
            throw new RuntimeException("LOCATION node does not exist!");
        }
        location = Utils.parseLocation(location_node);
        if (!hologram_node.isVirtual()) {
            hologram = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(hologram_node.getString()));
        }
        created_hologram = Utils.tryCreateHologram(location, hologram);
        start_preview_on_left_click = start_preview_on_left_click_node.getBoolean(false);
    } catch (Exception e) {
        GWMCrates.getInstance().getLogger().warn("Exception creating Block Case!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:20,代码来源:BlockCase.java

示例3: load

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public void load(ConfigurationNode node) {
    try {
        ConfigurationNode world_node = node.getNode("WORLD");
        ConfigurationNode x_node = node.getNode("X");
        ConfigurationNode y_node = node.getNode("Y");
        ConfigurationNode z_node = node.getNode("Z");
        if (!world_node.isVirtual()) {
            world_field.setText(world_node.getString());
        }
        if (!x_node.isVirtual()) {
            x_field.setText(integer ? String.valueOf(x_node.getInt()) : String.valueOf(x_node.getDouble()));
        }
        if (!y_node.isVirtual()) {
            y_field.setText(integer ? String.valueOf(y_node.getInt()) : String.valueOf(y_node.getDouble()));
        }
        if (!z_node.isVirtual()) {
            z_field.setText(integer ? String.valueOf(z_node.getInt()) : String.valueOf(z_node.getDouble()));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception loading Location Panel!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:23,代码来源:LocationPanel.java

示例4: PermissionOpenManager

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public PermissionOpenManager(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode permission_node = node.getNode("PERMISSION");
        ConfigurationNode open_manager1_node = node.getNode("OPEN_MANAGER1");
        ConfigurationNode open_manager2_node = node.getNode("OPEN_MANAGER2");
        if (permission_node.isVirtual()) {
            throw new RuntimeException("PERMISSION node does not exist!");
        }
        if (open_manager1_node.isVirtual()) {
            throw new RuntimeException("OPEN_MANAGER1 node does not exist!");
        }
        if (open_manager2_node.isVirtual()) {
            throw new RuntimeException("OPEN_MANAGER2 node does not exist!");
        }
        permission = permission_node.getString();
        open_manager1 = (OpenManager) Utils.createSuperObject(open_manager1_node, SuperObjectType.OPEN_MANAGER);
        open_manager2 = (OpenManager) Utils.createSuperObject(open_manager2_node, SuperObjectType.OPEN_MANAGER);

    } catch (Exception e) {
        throw new RuntimeException("Exception creating Permission Open Manager!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:24,代码来源:PermissionOpenManager.java

示例5: PermissionDrop

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public PermissionDrop(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode permission_node = node.getNode("PERMISSION");
        ConfigurationNode drop1_node = node.getNode("DROP1");
        ConfigurationNode drop2_node = node.getNode("DROP2");
        if (permission_node.isVirtual()) {
            throw new RuntimeException("PERMISSION node does not exist!");
        }
        if (drop1_node.isVirtual()) {
            throw new RuntimeException("DROP1 node does not exist!");
        }
        if (drop2_node.isVirtual()) {
            throw new RuntimeException("DROP2 node does not exist!");
        }
        permission = permission_node.getString();
        drop1 = (Drop) Utils.createSuperObject(drop1_node, SuperObjectType.DROP);
        drop2 = (Drop) Utils.createSuperObject(drop2_node, SuperObjectType.DROP);

    } catch (Exception e) {
        throw new RuntimeException("Exception creating Permission Drop!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:24,代码来源:PermissionDrop.java

示例6: load

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
    try {
        ConfigurationNode node = getNode();
        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_field.setText(display_name_node.getString());
        }
        if (!scroll_delay_node.isVirtual()) {
            scroll_delay_field.setText(String.valueOf(scroll_delay_node.getInt()));
        }
        if (!decorative_items_change_mode_node.isVirtual()) {
            decorative_items_change_mode_panel.setNode(decorative_items_change_mode_node);
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception loading First Preview Configuration Dialog!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:21,代码来源:FirstPreviewConfigurationDialog.java

示例7: getInternalValue

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private <T> E getInternalValue(T storageHandler) {
    if (storageHandler instanceof ConfigurationNode) {
        ConfigurationNode node = ((ConfigurationNode) storageHandler).getNode(this.key.get());

        if (node.isVirtual()) {
            this.modified = true;
        }

        if (this.comment != null && node instanceof CommentedConfigurationNode) {
            ((CommentedConfigurationNode) node).setComment(this.comment);
        }

        try {
            if (this.valueTypeToken != null) {
                return node.getValue(this.valueTypeToken, this.defaultValue);
            } else {
                return node.getValue(new TypeToken<E>(this.defaultValue.getClass()) {}, this.defaultValue);
            }
        } catch (Exception e) {
            return this.defaultValue;
        }
    }
    return null;
}
 
开发者ID:ichorpowered,项目名称:elderguardian,代码行数:25,代码来源:StorageValue.java

示例8: 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

示例9: EntityCase

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public EntityCase(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode entity_uuid_node = node.getNode("ENTITY_UUID");
        ConfigurationNode start_preview_on_left_click_node = node.getNode("START_PREVIEW_ON_LEFT_CLICK");
        if (entity_uuid_node.isVirtual()) {
            throw new RuntimeException("ENTITY_UUID node does not exist!");
        }
        entity_uuid = entity_uuid_node.getValue(TypeToken.of(UUID.class));
        start_preview_on_left_click = start_preview_on_left_click_node.getBoolean(false);
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Entity Case!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:15,代码来源:EntityCase.java

示例10: load

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
    try {
        ConfigurationNode node = getNode();
        ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
        ConfigurationNode delay_node = node.getNode("DELAY");
        if (!virtual_name_node.isVirtual()) {
            virtual_name_field.setText(virtual_name_node.getString());
        }
        if (!delay_node.isVirtual()) {
            delay_field.setText(String.valueOf(delay_node.getLong()));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception loading Timed Key Configuration Dialog!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:16,代码来源:TimedKeyConfigurationDialog.java

示例11: 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

示例12: VirtualCase

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public VirtualCase(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
        if (virtual_name_node.isVirtual()) {
            throw new RuntimeException("VIRTUAL_NAME node does not exist!");
        }
        virtual_name = virtual_name_node.getString();
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Virtual Case!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:13,代码来源:VirtualCase.java

示例13: 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

示例14: createSuperObject

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static SuperObject createSuperObject(ConfigurationNode node, SuperObjectType super_object_type) {
    ConfigurationNode type_node = node.getNode("TYPE");
    ConfigurationNode id_node = node.getNode("ID");
    if (type_node.isVirtual()) {
        throw new RuntimeException("TYPE node does not exist!");
    }
    String type = type_node.getString();
    String id = id_node.isVirtual() ? "Unknown ID" : id_node.getString().toLowerCase().replace(' ', '_');
    if (type.equals("SAVED")) {
        ConfigurationNode saved_id_node = node.getNode("SAVED_ID");
        if (saved_id_node.isVirtual()) {
            throw new RuntimeException("SAVED_ID node does not exist for Super Object \"" + super_object_type + "\" with type \"" + type + "\" and ID \"" + id + "\"!");
        }
        String saved_id = saved_id_node.getString();
        Optional<SuperObject> saved_super_object = getSavedSuperObject(super_object_type, saved_id);
        if (!saved_super_object.isPresent()) {
            throw new RuntimeException("Saved Super Object \"" + super_object_type + "\" with ID \"" + saved_id + "\" does not found!");
        }
        return saved_super_object.get();
    }
    Optional<SuperObjectStorage> optional_super_object_storage = getSuperObjectStorage(super_object_type, type);
    if (!optional_super_object_storage.isPresent()) {
        throw new RuntimeException("Type \"" + type + "\" for Super Object \"" + super_object_type + "\" does not found!");
    }
    SuperObjectStorage super_object_storage = optional_super_object_storage.get();
    try {
        Class<? extends SuperObject> super_object_class = super_object_storage.getSuperObjectClass();
        Constructor<? extends SuperObject> super_object_constructor = super_object_class.getConstructor(ConfigurationNode.class);
        SuperObject super_object = super_object_constructor.newInstance(node);
        return super_object;
    } catch (Exception e) {
        throw new RuntimeException("Exception creating Super Object \"" + super_object_type + "\" with type \"" + type + "\" and ID \"" + id + "\"!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:35,代码来源:Utils.java

示例15: load

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
    try {
        ConfigurationNode node = getNode();
        ConfigurationNode price_node = node.getNode("PRICE");
        if (!price_node.isVirtual()) {
            price_field.setText(String.valueOf(price_node.getDouble()));
        }
    } catch (Exception e) {
        throw new RuntimeException("Exception loading Case Configuration Dialog!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:12,代码来源:CaseConfigurationDialog.java


注:本文中的ninja.leaping.configurate.ConfigurationNode.isVirtual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。