1.7.10 commit of I-still-can't-do-any-branches

This commit is contained in:
WayofTime 2014-06-27 19:43:09 -04:00
parent 6aec0a87ea
commit cabc296b21
763 changed files with 64290 additions and 0 deletions

View file

@ -0,0 +1,55 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class HomSpellRegistry
{
public static List<HomSpellComponent> spellList = new ArrayList();
public static void registerBasicSpell(ItemStack item, HomSpell spell)
{
spellList.add(new HomSpellComponent(item, spell));
}
public static HomSpell getSpellForItemStack(ItemStack testItem)
{
if (testItem == null)
{
return null;
}
for (HomSpellComponent hsc : spellList)
{
ItemStack item = hsc.getItemStack();
if (item != null)
{
if (item.getItem() instanceof ItemBlock)
{
if (testItem.getItem() instanceof ItemBlock)
{
if (testItem.getItem() == item.getItem())
{
return hsc.getSpell();
}
}
} else
{
if (!(testItem.getItem() instanceof ItemBlock))
{
if (testItem.getItem() == item.getItem())
{
return hsc.getSpell();
}
}
}
}
}
return null;
}
}