Testing
This commit is contained in:
commit
8601e9faff
498 changed files with 45817 additions and 0 deletions
|
@ -0,0 +1,56 @@
|
|||
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.itemID == item.itemID)
|
||||
{
|
||||
return hsc.getSpell();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(testItem.getItem() instanceof ItemBlock))
|
||||
{
|
||||
if (testItem.itemID == item.itemID)
|
||||
{
|
||||
return hsc.getSpell();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue