use of WayofTime.bloodmagic.api.impl.recipe.RecipeBloodAltar in project BloodMagic by WayofTime.
the class BloodAltar method startCycle.
public void startCycle() {
if (tileAltar.getWorld() != null)
tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
checkTier();
if ((fluid == null || fluid.amount <= 0) && totalCharge <= 0)
return;
if (!isActive)
progress = 0;
ItemStack input = tileAltar.getStackInSlot(0);
if (!input.isEmpty()) {
// Do recipes
RecipeBloodAltar recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getBloodAltar(input);
if (recipe != null) {
if (recipe.getMinimumTier().ordinal() <= altarTier.ordinal()) {
this.isActive = true;
this.recipe = recipe;
this.liquidRequired = recipe.getSyphon();
this.consumptionRate = recipe.getConsumeRate();
this.drainRate = recipe.getDrainRate();
this.canBeFilled = false;
return;
}
} else if (input.getItem() instanceof IBloodOrb) {
this.isActive = true;
this.canBeFilled = true;
return;
}
}
isActive = false;
}
use of WayofTime.bloodmagic.api.impl.recipe.RecipeBloodAltar in project BloodMagic by WayofTime.
the class BloodMagicRecipeRegistrar method addBloodAltar.
@Override
public void addBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate) {
Preconditions.checkNotNull(input, "input cannot be null.");
Preconditions.checkNotNull(output, "output cannot be null.");
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
Preconditions.checkArgument(consumeRate >= 0, "consumeRate cannot be negative.");
Preconditions.checkArgument(drainRate >= 0, "drainRate cannot be negative.");
altarRecipes.add(new RecipeBloodAltar(input, output, minimumTier, syphon, consumeRate, drainRate));
}
Aggregations