Search in sources :

Example 1 with IRitualInteraction

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

the class CompendiumEntryRitual method getCompendiumGui.

@Override
@SideOnly(Side.CLIENT)
protected GuiArcaneCompendium getCompendiumGui(String searchID, int meta) {
    if (this.ritualShape != null) {
        try {
            Field f = RitualShapeHelper.class.getField(ritualShape);
            MultiblockStructureDefinition def = (MultiblockStructureDefinition) f.get(RitualShapeHelper.instance);
            ISkillTreeEntry entry = SkillManager.instance.getSkill(ritualController);
            if (entry instanceof IRitualInteraction) {
                IRitualInteraction controller = (IRitualInteraction) entry;
                return new GuiArcaneCompendium(searchID, def, controller);
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return new GuiArcaneCompendium(searchID);
}
Also used : Field(java.lang.reflect.Field) GuiArcaneCompendium(am2.guis.GuiArcaneCompendium) ISkillTreeEntry(am2.api.spell.component.interfaces.ISkillTreeEntry) IRitualInteraction(am2.api.spell.component.interfaces.IRitualInteraction) MultiblockStructureDefinition(am2.api.blocks.MultiblockStructureDefinition) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

MultiblockStructureDefinition (am2.api.blocks.MultiblockStructureDefinition)1 IRitualInteraction (am2.api.spell.component.interfaces.IRitualInteraction)1 ISkillTreeEntry (am2.api.spell.component.interfaces.ISkillTreeEntry)1 GuiArcaneCompendium (am2.guis.GuiArcaneCompendium)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 Field (java.lang.reflect.Field)1