use of gregtech.api.cover.CoverDefinition in project GregTech by GregTechCE.
the class PipeCoverableImplementation method readFromNBT.
public void readFromNBT(NBTTagCompound data) {
NBTTagList coversList = data.getTagList("Covers", NBT.TAG_COMPOUND);
for (int index = 0; index < coversList.tagCount(); index++) {
NBTTagCompound tagCompound = coversList.getCompoundTagAt(index);
if (tagCompound.hasKey("CoverId", NBT.TAG_STRING)) {
EnumFacing coverSide = EnumFacing.VALUES[tagCompound.getByte("Side")];
ResourceLocation coverId = new ResourceLocation(tagCompound.getString("CoverId"));
CoverDefinition coverDefinition = CoverDefinition.getCoverById(coverId);
CoverBehavior coverBehavior = coverDefinition.createCoverBehavior(this, coverSide);
coverBehavior.readFromNBT(tagCompound);
this.coverBehaviors[coverSide.getIndex()] = coverBehavior;
}
}
}
Aggregations