Alchemy arrays should mostly function now (#1202)

Rewrites the crafting recipe portion of alchemy arrays. Currently the rewritten
portion is wrapped in the old stuff. Ideally the remaining old stuff will
be rewritten as well.

Mods who wish to do custom array effects still need to depend on internal
classes and I think this is fine.
This commit is contained in:
Nicholas Ignoffo 2018-02-11 11:40:13 -08:00
parent 4b5f8a9685
commit 123b06c288
10 changed files with 239 additions and 34 deletions

View file

@ -1,7 +1,10 @@
package WayofTime.bloodmagic.tile;
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
import WayofTime.bloodmagic.apibutnotreally.Constants;
import WayofTime.bloodmagic.apibutnotreally.alchemyCrafting.AlchemyArrayEffect;
import WayofTime.bloodmagic.apibutnotreally.alchemyCrafting.AlchemyArrayEffectCraftingNew;
import WayofTime.bloodmagic.apibutnotreally.iface.IAlchemyArray;
import WayofTime.bloodmagic.apibutnotreally.registry.AlchemyArrayRecipeRegistry;
import net.minecraft.block.state.IBlockState;
@ -107,7 +110,18 @@ public class TileAlchemyArray extends TileInventory implements ITickable, IAlche
}
}
} else {
return false;
RecipeAlchemyArray recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArray(getStackInSlot(0), getStackInSlot(1));
if (recipe == null)
return false;
AlchemyArrayEffect newEffect = new AlchemyArrayEffectCraftingNew(recipe);
if (arrayEffect == null) {
arrayEffect = newEffect;
key = newEffect.key;
} else if (!newEffect.key.equals(key)) {
arrayEffect = newEffect;
key = newEffect.key;
}
}
if (arrayEffect != null) {