Fixed Orb filling and added the Weak Blood Orb as a fillable orb.
This commit is contained in:
parent
4145b2a11c
commit
f1a3c5ee46
|
@ -21,6 +21,7 @@ import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
|||
import WayofTime.bloodmagic.api.altar.IAltarComponent;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.block.BlockBloodRune;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
|
@ -263,19 +264,15 @@ public class BloodAltar {
|
|||
|
||||
if (tileAltar.getStackInSlot(0) != null) {
|
||||
// Do recipes
|
||||
for (ItemStack itemStack : AltarRecipeRegistry.getRecipes().keySet()) {
|
||||
if (tileAltar.getStackInSlot(0).getIsItemStackEqual(AltarRecipeRegistry.getRecipes().get(itemStack).getInput())) {
|
||||
AltarRecipeRegistry.AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(itemStack);
|
||||
|
||||
if (altarTier.ordinal() >= recipe.getMinTier().ordinal()) {
|
||||
this.isActive = true;
|
||||
this.result = new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata());
|
||||
this.liquidRequired = recipe.getSyphon();
|
||||
this.canBeFilled = recipe.isUseTag();
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
return;
|
||||
}
|
||||
for (AltarRecipe recipe : AltarRecipeRegistry.getRecipes().values()) {
|
||||
if (recipe.doesRequiredItemMatch(tileAltar.getStackInSlot(0), altarTier)) {
|
||||
this.isActive = true;
|
||||
this.result = new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata());
|
||||
this.liquidRequired = recipe.getSyphon();
|
||||
this.canBeFilled = recipe.isUseTag();
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -379,6 +376,7 @@ public class BloodAltar {
|
|||
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + Math.random() - Math.random(), pos.getY() + Math.random() - Math.random(), pos.getZ() + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Test2");
|
||||
ItemStack returnedItem = tileAltar.getStackInSlot(0);
|
||||
|
||||
if (!(returnedItem.getItem() instanceof IBloodOrb))
|
||||
|
|
|
@ -83,5 +83,15 @@ public class AltarRecipeRegistry {
|
|||
public AltarRecipe(ItemStack input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
||||
this(input, null, minTier, 0, consumeRate, drainRate);
|
||||
}
|
||||
|
||||
public boolean doesRequiredItemMatch(ItemStack comparedStack, EnumAltarTier tierCheck)
|
||||
{
|
||||
if (comparedStack == null || this.input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return tierCheck.ordinal() >= minTier.ordinal() && this.input.isItemEqual(comparedStack);// && (this.useTag ? this.areRequiredTagsEqual(comparedStack) : true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public class ModRecipes {
|
|||
|
||||
public static void addAltarRecipes() {
|
||||
// ONE
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(OrbRegistry.getOrbStack(ModItems.orbWeak), OrbRegistry.getOrbStack(ModItems.orbWeak), EnumAltarTier.ONE, 5000, 2, 1, true));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.diamond), OrbRegistry.getOrbStack(ModItems.orbWeak), EnumAltarTier.ONE, 2000, 2, 1, false));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.stone), new ItemStack(ModItems.slate), EnumAltarTier.ONE, 1000, 5, 5, false));
|
||||
|
||||
|
|
Loading…
Reference in a new issue