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);
}
}
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);
}
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);
}
}
Aggregations