Search in sources :

Example 1 with ElytraUpgrade

use of crazypants.enderio.base.item.darksteel.upgrade.elytra.ElytraUpgrade in project EnderIO by SleepyTrousers.

the class ItemDarkSteelArmor method getSubItems.

@Override
@SideOnly(Side.CLIENT)
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> par3List) {
    if (isInCreativeTab(tab)) {
        @Nonnull ItemStack is = new ItemStack(this);
        par3List.add(is);
        is = new ItemStack(this);
        EnergyUpgrade.EMPOWERED_FOUR.addToItem(is, this);
        EnergyUpgradeManager.setPowerFull(is, this);
        Iterator<IDarkSteelUpgrade> iter = DarkSteelRecipeManager.recipeIterator();
        while (iter.hasNext()) {
            IDarkSteelUpgrade upgrade = iter.next();
            if (!(upgrade instanceof EnergyUpgrade || upgrade instanceof GliderUpgrade || upgrade instanceof ElytraUpgrade) && upgrade.canAddToItem(is, this)) {
                upgrade.addToItem(is, this);
            }
        }
        if (GliderUpgrade.INSTANCE.canAddToItem(is, this)) {
            ItemStack is2 = is.copy();
            GliderUpgrade.INSTANCE.addToItem(is2, this);
            par3List.add(is2);
            if (ElytraUpgrade.INSTANCE.canAddToItem(is, this)) {
                ItemStack is3 = is.copy();
                ElytraUpgrade.INSTANCE.addToItem(is3, this);
                par3List.add(is3);
            }
            return;
        }
        par3List.add(is);
    }
}
Also used : GliderUpgrade(crazypants.enderio.base.item.darksteel.upgrade.glider.GliderUpgrade) Nonnull(javax.annotation.Nonnull) ElytraUpgrade(crazypants.enderio.base.item.darksteel.upgrade.elytra.ElytraUpgrade) EnergyUpgrade(crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade) ItemStack(net.minecraft.item.ItemStack) IDarkSteelUpgrade(crazypants.enderio.api.upgrades.IDarkSteelUpgrade) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

IDarkSteelUpgrade (crazypants.enderio.api.upgrades.IDarkSteelUpgrade)1 ElytraUpgrade (crazypants.enderio.base.item.darksteel.upgrade.elytra.ElytraUpgrade)1 EnergyUpgrade (crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade)1 GliderUpgrade (crazypants.enderio.base.item.darksteel.upgrade.glider.GliderUpgrade)1 Nonnull (javax.annotation.Nonnull)1 ItemStack (net.minecraft.item.ItemStack)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1