ValidatorBlockDescriptor.java 文件源码

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

项目:CustomOreGen 作者:
protected boolean validateChildren() throws ParserException
 {
     super.validateChildren();
     this.blocks = this.validateRequiredAttribute(String.class, "Block", true);
     this.weight = this.validateNamedAttribute(Float.class, "Weight", this.weight, true);
     String nbtJson = this.validateNamedAttribute(String.class, "NBT", null, true);
     if (nbtJson != null) {
        try {
            NBTBase base = JsonToNBT.getTagFromJson(nbtJson);
            if (base instanceof NBTTagCompound) {
                this.nbt = (NBTTagCompound)base;
            } else {
                throw new ParserException("NBT is not a compound tag");
            }
} catch (NBTException e) {
    throw new ParserException("Failed to parse JSON", e);
}
     }
     return true;
 }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号