InteractRequirement.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:QuestManager 作者:
@Override
public void fromConfig(ConfigurationSection config) throws InvalidConfigurationException {
    /*
     * type: intr
     * location: [loc]
     * [face]: [face enum name]
     * [action]: {LEFT/RIGHT}
     */

    if (!config.contains("type") || !config.getString("type").equals("intr")) {
        throw new InvalidConfigurationException("\n  ---Invalid type! Expected 'intr' but got " + config.get("type", "null"));
    }

    this.location = ((LocationState) config.get("location")).getLocation();

    if (config.contains("face")) {
        this.face = BlockFace.valueOf(config.getString("face"));
    }

    if (config.contains("action")) {
        this.action = getAction(config.getString("action"));
    }

    this.desc = config.getString("description", config.getString("action", "Right")
            + " click the area");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号