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


Java ConfigurationNode.getString方法代码示例

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


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

示例3: PermissionPreview

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public PermissionPreview(ConfigurationNode node) {
    super(node);
    try {
        ConfigurationNode permission_node = node.getNode("PERMISSION");
        ConfigurationNode preview1_node = node.getNode("PREVIEW1");
        ConfigurationNode preview2_node = node.getNode("PREVIEW2");
        if (permission_node.isVirtual()) {
            throw new RuntimeException("PERMISSION node does not exist!");
        }
        if (preview1_node.isVirtual()) {
            throw new RuntimeException("PREVIEW1 node does not exist!");
        }
        if (preview2_node.isVirtual()) {
            throw new RuntimeException("PREVIEW2 node does not exist!");
        }
        permission = permission_node.getString();
        preview1 = (Preview) Utils.createSuperObject(preview1_node, SuperObjectType.PREVIEW);
        preview2 = (Preview) Utils.createSuperObject(preview2_node, SuperObjectType.PREVIEW);

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

示例4: getFaction

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static Faction getFaction(String factionName)
{
    ConfigurationNode leaderNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "leader");

    String leaderUUID = "";
    if(leaderNode.getValue() != null) leaderUUID = leaderNode.getString();

    ConfigurationNode tagNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "tag");

    String factionTag = "";
    if(tagNode.getValue() != null) factionTag = tagNode.getString();

    Faction faction = new Faction(factionName, factionTag, leaderUUID);

    faction.Members = getMembers(factionName);
    faction.Officers = getOfficers(factionName);
    faction.Enemies = getEnemies(factionName);
    faction.Alliances = getAlliances(factionName);
    faction.Claims = getClaims(factionName);
    faction.Power = PowerService.getFactionPower(faction);

    return faction;
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:24,代码来源:FactionLogic.java

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

示例6: getLeader

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static String getLeader(String factionName)
{
    ConfigurationNode valueNode = ConfigAccess.getConfig(factionsConfig).getNode((Object[]) ("factions." + factionName + ".leader").split("\\."));

    if (valueNode.getValue() != null)
        return valueNode.getString();
    else
        return "";
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:10,代码来源:FactionLogic.java

示例7: SuperObject

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public SuperObject(ConfigurationNode node) {
    ConfigurationNode type_node = node.getNode("TYPE");
    ConfigurationNode id_node = node.getNode("ID");
    if (type_node.isVirtual()) {
        throw new RuntimeException("TYPE node does not exist for Super Object!");
    }
    type = type_node.getString();
    id = id_node.isVirtual() ? Optional.empty() : Optional.of(id_node.getString());
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:10,代码来源:SuperObject.java

示例8: parseLocation

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static Location<World> parseLocation(ConfigurationNode node) {
    ConfigurationNode x_node = node.getNode("X");
    ConfigurationNode y_node = node.getNode("Y");
    ConfigurationNode z_node = node.getNode("Z");
    ConfigurationNode world_node = node.getNode("WORLD_NAME");
    if (x_node.isVirtual()) {
        throw new RuntimeException("X node does not exist!");
    }
    if (y_node.isVirtual()) {
        throw new RuntimeException("Y node does not exist!");
    }
    if (z_node.isVirtual()) {
        throw new RuntimeException("Z node does not exist!");
    }
    if (world_node.isVirtual()) {
        throw new RuntimeException("WORLD_NAME node does not exist!");
    }
    double x = x_node.getDouble();
    double y = y_node.getDouble();
    double z = z_node.getDouble();
    String world_name = world_node.getString();
    Optional<World> optional_world = Sponge.getServer().getWorld(world_name);
    if (!optional_world.isPresent()) {
        throw new RuntimeException("World \"" + world_name + "\" does not exist!");
    }
    World world = optional_world.get();
    return new Location<World>(world, x, y, z);
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:29,代码来源:Utils.java

示例9: parseCommand

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static CommandsDrop.Command parseCommand(ConfigurationNode node) {
    ConfigurationNode cmd_node = node.getNode("CMD");
    ConfigurationNode console_node = node.getNode("CONSOLE");
    if (cmd_node.isVirtual()) {
        throw new RuntimeException("CMD node does not exist!");
    }
    String cmd = cmd_node.getString();
    boolean console = console_node.getBoolean(true);
    return new CommandsDrop.Command(cmd, console);
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:11,代码来源:Utils.java

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

示例11: getHome

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static Vector3i getHome(String factionName)
{
    ConfigurationNode homeNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "home");

    if(homeNode.getValue() != null)
    {
        String homeString = homeNode.getString();
        String splitter = "\\|";

      //  String worldUUID = homeString.split(splitter)[0];
        String vectorsString = homeString.split(splitter)[1];

        String vectors[] = vectorsString.replace("(", "").replace(")", "").replace(" ", "").split(",");

         int x = Integer.valueOf(vectors[0]);
         int y = Integer.valueOf(vectors[1]);
         int z = Integer.valueOf(vectors[2]);

         Vector3i home = Vector3i.from(x, y, z);

         return home;
    }
    else
    {
        return null;
    }
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:28,代码来源:FactionLogic.java

示例12: VirtualKey

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public VirtualKey(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 Key!", e);
    }
}
 
开发者ID:GreWeMa,项目名称:gwm_Crates,代码行数:13,代码来源:VirtualKey.java

示例13: getPlayerChunkPosition

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static Vector3i getPlayerChunkPosition(UUID playerUUID)
{
    Path playerFile = Paths.get(EagleFactions.getEagleFactions ().getConfigDir().resolve("players") +  "/" + playerUUID.toString() + ".conf");

    try
    {
        ConfigurationLoader<CommentedConfigurationNode> configLoader = HoconConfigurationLoader.builder().setPath(playerFile).build();
        CommentedConfigurationNode playerNode = configLoader.load();
        ConfigurationNode chunkPositionNode = playerNode.getNode("chunkPosition");

        if(chunkPositionNode.getValue() != null)
        {
            String object = chunkPositionNode.getString();

            String vectors[] = object.replace("(", "").replace(")", "").replace(" ", "").split(",");

            int x = Integer.valueOf(vectors[0]);
            int y = Integer.valueOf(vectors[1]);
            int z = Integer.valueOf(vectors[2]);

            Vector3i chunk = Vector3i.from(x, y, z);

            return chunk;
        }
        else
        {
            return new Vector3i(0,0,0);
        }
    }
    catch (Exception exception)
    {
        exception.printStackTrace();
    }
    return null;
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:36,代码来源:PlayerService.java

示例14: getGlobalMaxPower

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static BigDecimal getGlobalMaxPower()
{
    ConfigurationNode maxPowerNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "power", "maxpower");

    BigDecimal maxPower = new BigDecimal(maxPowerNode.getString());

    return maxPower;
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:9,代码来源:MainLogic.java

示例15: getPowerIncrement

import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static BigDecimal getPowerIncrement()
{
    ConfigurationNode powerIncrementNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "power", "increment");

    BigDecimal incrementPower = new BigDecimal(powerIncrementNode.getString());

    return incrementPower;
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:9,代码来源:MainLogic.java


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