use of am2.spell.shapes.Binding in project ArsMagica2 by Mithion.
the class TileEntityCraftingAltar method matchCurrentRecipe.
private boolean matchCurrentRecipe() {
ISpellPart part = SpellRecipeManager.instance.getPartByRecipe(currentAddedItems);
if (part == null)
return false;
ArrayList<KeyValuePair<ISpellPart, byte[]>> currentShapeGroupList = getShapeGroupToAddTo();
if (part instanceof Summon)
handleSummonShape();
if (part instanceof Binding)
handleBindingShape();
byte[] metaData = new byte[0];
if (part instanceof ISpellModifier) {
metaData = ((ISpellModifier) part).getModifierMetadata(currentAddedItems.toArray(new ItemStack[currentAddedItems.size()]));
if (metaData == null) {
metaData = new byte[0];
}
}
//we're now creating the body of the spell
if (currentShapeGroupList == null) {
spellDef.add(new KeyValuePair<ISpellPart, byte[]>(part, metaData));
} else {
currentShapeGroupList.add(new KeyValuePair<ISpellPart, byte[]>(part, metaData));
}
return true;
}
use of am2.spell.shapes.Binding in project ArsMagica2 by Mithion.
the class TileEntityCraftingAltar method AddSpecialMetadata.
private void AddSpecialMetadata(ItemStack craftStack) {
if (addedPhylactery != null) {
Summon summon = (Summon) SkillManager.instance.getSkill("Summon");
summon.setSummonType(craftStack, addedPhylactery);
}
if (addedBindingCatalyst != null) {
Binding binding = (Binding) SkillManager.instance.getSkill("Binding");
binding.setBindingType(craftStack, addedBindingCatalyst);
}
}
Aggregations