@Override
public void fromConfig(ConfigurationSection config) throws InvalidConfigurationException {
//we need to load information about what we need to possess and how much
//our config is
// type: "delr"
// itemYype: (Material. ENUM CONSTANT NAME)
// count: [int]
// name: [string]
if (!config.contains("type") || !config.getString("type").equals("delr")) {
throw new InvalidConfigurationException("\n ---Invalid type! Expected 'delr' but got " + config.getString("type", "null"));
}
this.itemType = Material.valueOf(
config.getString("itemType", "AIR"));
this.itemCount = config.getInt("count", 1);
this.itemName = config.getString("name", "");
if (itemName.trim().isEmpty()) {
itemName = null;
}
this.desc = config.getString("description", "Collect " + itemCount + " " +
itemName == null ? itemType.toString() : itemName);
}
DeliverRequirement.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:QuestManager
作者:
评论列表
文章目录