Search in sources :

Example 11 with ISpellShape

use of am2.api.spell.component.interfaces.ISpellShape in project ArsMagica2 by Mithion.

the class ItemSpellPart method registerIcons.

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister IIconRegister) {
    ArrayList<Integer> parts = SkillManager.instance.getAllShapes();
    parts.addAll(SkillManager.instance.getAllComponents());
    parts.addAll(SkillManager.instance.getAllModifiers());
    parts.addAll(SkillManager.instance.getAllTalents());
    int count = 0;
    for (Integer i : parts) {
        if (i == null)
            continue;
        ISkillTreeEntry entry = SkillManager.instance.getSkill(i);
        String subfolder = "";
        if (entry instanceof ISpellShape)
            subfolder = "shapes";
        else if (entry instanceof ISpellComponent)
            subfolder = "components";
        else if (entry instanceof ISpellModifier)
            subfolder = "modifiers";
        else
            subfolder = "skills";
        String skillName = SkillManager.instance.getSkillName(entry);
        IIcon IIcon = ResourceManager.RegisterTexture(String.format("spells/%s/%s.png", subfolder, skillName), IIconRegister);
        SpellIconManager.instance.registerIcon(skillName, IIcon);
    }
}
Also used : ISpellComponent(am2.api.spell.component.interfaces.ISpellComponent) IIcon(net.minecraft.util.IIcon) ISkillTreeEntry(am2.api.spell.component.interfaces.ISkillTreeEntry) ISpellModifier(am2.api.spell.component.interfaces.ISpellModifier) ISpellShape(am2.api.spell.component.interfaces.ISpellShape) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

ISpellShape (am2.api.spell.component.interfaces.ISpellShape)9 ISpellComponent (am2.api.spell.component.interfaces.ISpellComponent)5 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)4 ItemStack (net.minecraft.item.ItemStack)4 ISpellPart (am2.api.spell.component.interfaces.ISpellPart)2 AMDataWriter (am2.network.AMDataWriter)2 Summon (am2.spell.components.Summon)2 Colour (am2.spell.modifiers.Colour)2 ArrayList (java.util.ArrayList)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 AffinityChangingEvent (am2.api.events.AffinityChangingEvent)1 SkillLearnedEvent (am2.api.events.SkillLearnedEvent)1 SpellCastingEvent (am2.api.events.SpellCastingEvent)1 ItemSpellBase (am2.api.spell.ItemSpellBase)1 ISkillTreeEntry (am2.api.spell.component.interfaces.ISkillTreeEntry)1 Affinity (am2.api.spell.enums.Affinity)1 SpellCastResult (am2.api.spell.enums.SpellCastResult)1 AffinityData (am2.playerextensions.AffinityData)1 MissingShape (am2.spell.shapes.MissingShape)1 KeyValuePair (am2.utility.KeyValuePair)1