Search in sources :

Example 6 with MetaValueItem

use of gregtech.api.items.metaitem.MetaItem.MetaValueItem in project GregTech by GregTechCE.

the class ToolRecipeHandler method processSimpleElectricToolHead.

public static void processSimpleElectricToolHead(OrePrefix toolPrefix, SolidMaterial solidMaterial, MetaToolValueItem[] toolItems) {
    for (int i = 0; i < toolItems.length; i++) {
        for (MetaValueItem batteryItem : batteryItems[i]) {
            ItemStack batteryStack = batteryItem.getStackForm();
            long maxCharge = batteryStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null).getMaxCharge();
            ItemStack chargedDrillStack = toolItems[i].getMaxChargeOverrideStack(solidMaterial, maxCharge);
            String recipeNameFirst = String.format("%s_%s_%s_full", toolItems[i].unlocalizedName, solidMaterial, batteryItem.unlocalizedName);
            ModHandler.addShapedEnergyTransferRecipe(recipeNameFirst, chargedDrillStack, Ingredient.fromStacks(batteryStack), false, "SXd", "GMG", "PBP", 'X', new UnificationEntry(toolPrefix, solidMaterial), 'M', motorItems[i].getStackForm(), 'S', new UnificationEntry(OrePrefix.screw, baseMaterials[i]), 'P', new UnificationEntry(OrePrefix.plate, baseMaterials[i]), 'G', new UnificationEntry(OrePrefix.gearSmall, baseMaterials[i]), 'B', batteryStack);
        }
        ItemStack drillStack = toolItems[i].getStackForm(solidMaterial);
        ItemStack powerUnitStack = powerUnitItems[i].getStackForm();
        String recipeNameSecond = String.format("%s_%s_unit", toolItems[i].unlocalizedName, solidMaterial);
        ModHandler.addShapedEnergyTransferRecipe(recipeNameSecond, drillStack, Ingredient.fromStacks(powerUnitStack), true, "wHd", " U ", 'H', new UnificationEntry(toolPrefix, solidMaterial), 'U', powerUnitStack);
    }
}
Also used : MetaValueItem(gregtech.api.items.metaitem.MetaItem.MetaValueItem) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 7 with MetaValueItem

use of gregtech.api.items.metaitem.MetaItem.MetaValueItem in project GregTech by GregTechCE.

the class ToolRecipeHandler method processLongStick.

public static void processLongStick(OrePrefix orePrefix, IngotMaterial material) {
    if (material.toolDurability <= 0)
        return;
    processSimpleElectricToolHead(orePrefix, material, new MetaToolValueItem[] { MetaItems.SCREWDRIVER_LV });
    for (MetaValueItem batteryItem : batteryItems[2]) {
        ItemStack batteryStack = batteryItem.getStackForm();
        long maxCharge = batteryStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null).getMaxCharge();
        ItemStack chargedHammerStack = MetaItems.JACKHAMMER.getMaxChargeOverrideStack(material, maxCharge);
        String recipeNameFirst = String.format("jack_hammer_%s_%s_full", batteryItem.unlocalizedName, material.toString());
        ModHandler.addShapedEnergyTransferRecipe(recipeNameFirst, chargedHammerStack, Ingredient.fromStacks(batteryStack), false, "SXd", "PRP", "MPB", 'X', new UnificationEntry(OrePrefix.stickLong, material), 'M', MetaItems.ELECTRIC_PISTON_HV.getStackForm(), 'S', new UnificationEntry(OrePrefix.screw, Materials.Titanium), 'P', new UnificationEntry(OrePrefix.plateDense, Materials.Titanium), 'R', new UnificationEntry(OrePrefix.spring, Materials.Titanium), 'B', batteryStack);
    }
    ItemStack drillStack = MetaItems.JACKHAMMER.getStackForm(material);
    ItemStack powerUnitStack = MetaItems.JACKHAMMER_BASE.getStackForm();
    String recipeNameSecond = String.format("jack_hammer_%s_unit", material);
    ModHandler.addShapedEnergyTransferRecipe(recipeNameSecond, drillStack, Ingredient.fromStacks(powerUnitStack), true, "wHd", " U ", 'H', new UnificationEntry(orePrefix, material), 'U', powerUnitStack);
}
Also used : MetaValueItem(gregtech.api.items.metaitem.MetaItem.MetaValueItem) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 8 with MetaValueItem

use of gregtech.api.items.metaitem.MetaItem.MetaValueItem in project GregTech by GregTechCE.

the class ToolRecipeHandler method registerPowerUnitRecipes.

public static void registerPowerUnitRecipes() {
    for (int i = 0; i < powerUnitItems.length; i++) {
        for (MetaValueItem batteryItem : batteryItems[i]) {
            ItemStack batteryStack = batteryItem.getStackForm();
            long maxCharge = batteryStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null).getMaxCharge();
            ItemStack powerUnitStack = powerUnitItems[i].getMaxChargeOverrideStack(maxCharge);
            String recipeName = String.format("%s_%s", powerUnitItems[i].unlocalizedName, batteryItem.unlocalizedName);
            ModHandler.addShapedEnergyTransferRecipe(recipeName, powerUnitStack, Ingredient.fromStacks(batteryStack), false, "S  ", "GMG", "PBP", 'M', motorItems[i].getStackForm(), 'S', new UnificationEntry(OrePrefix.screw, baseMaterials[i]), 'P', new UnificationEntry(OrePrefix.plate, baseMaterials[i]), 'G', new UnificationEntry(OrePrefix.gearSmall, baseMaterials[i]), 'B', batteryStack);
        }
    }
    for (MetaValueItem batteryItem : batteryItems[2]) {
        ItemStack batteryStack = batteryItem.getStackForm();
        long maxCharge = batteryStack.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null).getMaxCharge();
        ItemStack hammerBaseStack = MetaItems.JACKHAMMER_BASE.getMaxChargeOverrideStack(maxCharge);
        String recipeName = String.format("jackhammer_base_%s", batteryItem.unlocalizedName);
        ModHandler.addShapedEnergyTransferRecipe(recipeName, hammerBaseStack, Ingredient.fromStacks(batteryStack), false, "S  ", "PRP", "MPB", 'M', MetaItems.ELECTRIC_PISTON_HV.getStackForm(), 'S', new UnificationEntry(OrePrefix.screw, Materials.Titanium), 'P', new UnificationEntry(OrePrefix.plateDense, Materials.Titanium), 'R', new UnificationEntry(OrePrefix.spring, Materials.Titanium), 'B', batteryStack);
    }
}
Also used : MetaValueItem(gregtech.api.items.metaitem.MetaItem.MetaValueItem) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Aggregations

MetaValueItem (gregtech.api.items.metaitem.MetaItem.MetaValueItem)8 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)5 ItemStack (net.minecraft.item.ItemStack)5 MetaItem (gregtech.api.items.metaitem.MetaItem)3 Material (gregtech.api.unification.material.type.Material)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 GTValues (gregtech.api.GTValues)1 IElectricItem (gregtech.api.capability.IElectricItem)1 MaterialMetaItem (gregtech.api.items.materialitem.MaterialMetaItem)1 IItemDurabilityManager (gregtech.api.items.metaitem.stats.IItemDurabilityManager)1 IToolStats (gregtech.api.items.toolitem.IToolStats)1 ToolMetaItem (gregtech.api.items.toolitem.ToolMetaItem)1 MetaToolValueItem (gregtech.api.items.toolitem.ToolMetaItem.MetaToolValueItem)1 ModHandler (gregtech.api.recipes.ModHandler)1 IntCircuitIngredient (gregtech.api.recipes.ingredients.IntCircuitIngredient)1 OreDictUnifier (gregtech.api.unification.OreDictUnifier)1 Tier (gregtech.api.unification.material.MarkerMaterials.Tier)1 Materials (gregtech.api.unification.material.Materials)1 DyeUtil (gregtech.api.util.DyeUtil)1 GTLog (gregtech.api.util.GTLog)1