use of hellfirepvp.astralsorcery.common.crafting.nojson.attunement.AttunementRecipe in project AstralSorcery by HellFirePvP.
the class TileAttunementAltar method readNetNBT.
@Override
public void readNetNBT(CompoundNBT compound) {
super.readNetNBT(compound);
if (compound.contains("activeConstellation")) {
this.activeConstellation = ConstellationRegistry.getConstellation(new ResourceLocation(compound.getString("activeConstellation")));
} else {
this.activeConstellation = null;
}
if (compound.contains("currentRecipe")) {
CompoundNBT nbt = compound.getCompound("currentRecipe");
AttunementRecipe recipe = AttunementCraftingRegistry.INSTANCE.getRecipe(new ResourceLocation(nbt.getString("recipe")));
if (recipe != null) {
this.currentRecipe = recipe.deserialize(this, nbt, this.currentRecipe);
} else if (this.currentRecipe != null) {
this.currentRecipe.stopEffects(this);
this.currentRecipe = null;
}
} else if (this.currentRecipe != null) {
this.currentRecipe.stopEffects(this);
this.currentRecipe = null;
}
}
Aggregations