Search in sources :

Example 6 with IDarkSteelUpgrade

use of crazypants.enderio.api.upgrades.IDarkSteelUpgrade in project EnderIO by SleepyTrousers.

the class DarkSteelRecipeManager method handleUpgrade.

private static void handleUpgrade(AnvilUpdateEvent evt, @Nonnull IDarkSteelItem item) {
    for (IDarkSteelUpgrade upgrade : UpgradeRegistry.getUpgrades()) {
        if (upgrade.isUpgradeItem(evt.getRight()) && upgrade.canAddToItem(evt.getLeft(), item)) {
            ItemStack res = new ItemStack(evt.getLeft().getItem(), 1, evt.getLeft().getItemDamage());
            final NBTTagCompound tagCompound = evt.getLeft().getTagCompound();
            if (tagCompound != null) {
                res.setTagCompound(tagCompound.copy());
            }
            upgrade.addToItem(res, item);
            evt.setOutput(res);
            evt.setCost(upgrade.getLevelCost());
            return;
        }
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) IDarkSteelUpgrade(crazypants.enderio.api.upgrades.IDarkSteelUpgrade)

Example 7 with IDarkSteelUpgrade

use of crazypants.enderio.api.upgrades.IDarkSteelUpgrade in project EnderIO by SleepyTrousers.

the class ForestryControl method registerDarkSteelUpgrades.

@SubscribeEvent
public static void registerDarkSteelUpgrades(@Nonnull RegistryEvent.Register<IDarkSteelUpgrade> event) {
    final IForgeRegistry<IDarkSteelUpgrade> registry = event.getRegistry();
    registry.register(new NaturalistEyeUpgrade());
    registry.register(new ApiaristArmorUpgrade(EntityEquipmentSlot.FEET));
    registry.register(new ApiaristArmorUpgrade(EntityEquipmentSlot.LEGS));
    registry.register(new ApiaristArmorUpgrade(EntityEquipmentSlot.CHEST));
    registry.register(new ApiaristArmorUpgrade(EntityEquipmentSlot.HEAD));
    Log.info("Dark Steel Upgrades: Forestry integration loaded");
}
Also used : NaturalistEyeUpgrade(crazypants.enderio.integration.forestry.upgrades.NaturalistEyeUpgrade) ApiaristArmorUpgrade(crazypants.enderio.integration.forestry.upgrades.ApiaristArmorUpgrade) IDarkSteelUpgrade(crazypants.enderio.api.upgrades.IDarkSteelUpgrade) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

IDarkSteelUpgrade (crazypants.enderio.api.upgrades.IDarkSteelUpgrade)7 ItemStack (net.minecraft.item.ItemStack)5 IDarkSteelItem (crazypants.enderio.api.upgrades.IDarkSteelItem)4 EntityEquipmentSlot (net.minecraft.inventory.EntityEquipmentSlot)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 IAdvancedTooltipProvider (com.enderio.core.api.client.gui.IAdvancedTooltipProvider)1 NNList (com.enderio.core.common.util.NNList)1 IHasPlayerRenderer (crazypants.enderio.api.upgrades.IHasPlayerRenderer)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 ApiaristArmorUpgrade (crazypants.enderio.integration.forestry.upgrades.ApiaristArmorUpgrade)1 NaturalistEyeUpgrade (crazypants.enderio.integration.forestry.upgrades.NaturalistEyeUpgrade)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 IInventory (net.minecraft.inventory.IInventory)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1