Search in sources :

Example 11 with SimpleItemStack

use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.

the class ProcessingPure method registerOre.

public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material instanceof SolidMaterial) {
        SolidMaterial material = (SolidMaterial) entry.material;
        ItemStack stack = simpleStack.asItemStack();
        DustMaterial byproductMaterial = GTUtility.selectItemInList(1, material, material.oreByProducts, DustMaterial.class);
        ItemStack pureDustStack = OreDictUnifier.get(OrePrefix.dustPure, material);
        if (pureDustStack.isEmpty()) {
            // fallback for reduced & cleanGravel
            pureDustStack = OreDictUnifier.get(OrePrefix.dust, material);
        }
        RecipeMap.HAMMER_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.dustPure, material)).duration(10).EUt(16).buildAndRegister();
        RecipeMap.MACERATOR_RECIPES.recipeBuilder().inputs(stack).outputs(pureDustStack).chancedOutput(OreDictUnifier.get(OrePrefix.dust, byproductMaterial), 1000).buildAndRegister();
    }
}
Also used : SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) DustMaterial(gregtech.api.unification.material.type.DustMaterial) ItemStack(net.minecraft.item.ItemStack) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack)

Example 12 with SimpleItemStack

use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.

the class ProcessingToolOther method registerOre.

// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material != Materials.Stone && entry.material != Materials.Flint) {
        if (entry.material != Materials.Rubber) {
            ModHandler.addShapedRecipe("plunger_" + entry.material + "_" + entry.material, MetaItems.PLUNGER.getStackForm(entry.material, entry.material), "xRR", " SR", "S f", 'S', new UnificationEntry(OrePrefix.stick, entry.material), 'R', new UnificationEntry(OrePrefix.plate, Materials.Rubber));
        }
        if (!ModHandler.isMaterialWood(entry.material) && !entry.material.hasFlag(NO_SMASHING)) {
            if (entry.material instanceof SolidMaterial) {
                SolidMaterial solidMaterial = (SolidMaterial) entry.material;
                ModHandler.addShapedRecipe("screwdriver_" + solidMaterial + "_" + solidMaterial.handleMaterial, MetaItems.SCREWDRIVER.getStackForm(solidMaterial, solidMaterial.handleMaterial), " fS", " Sh", "W  ", 'S', OreDictUnifier.get(OrePrefix.stick, solidMaterial), 'W', OreDictUnifier.get(OrePrefix.stick, solidMaterial));
            }
            ModHandler.addShapedRecipe("wrench_" + entry.material + "_" + entry.material, MetaItems.WRENCH.getStackForm(entry.material, entry.material), "IhI", "III", " I ", 'I', OreDictUnifier.get(OrePrefix.ingot, entry.material));
            ModHandler.addShapedRecipe("crowbar_" + entry.material + "_" + entry.material, MetaItems.CROWBAR.getStackForm(entry.material, entry.material), "hDS", "DSD", "SDf", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'D', EnumDyeColor.BLUE);
            ModHandler.addShapedRecipe("wirecutter_" + entry.material + "_" + entry.material, MetaItems.WIRECUTTER.getStackForm(entry.material, entry.material), "PfP", "hPd", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
            ModHandler.addShapedRecipe("scoop_" + entry.material + "_" + entry.material, MetaItems.SCOOP.getStackForm(entry.material, entry.material), "SWS", "SSS", "xSh", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'W', new ItemStack(Blocks.WOOL, 1, 32767));
            ModHandler.addShapedRecipe("branchcutter_" + entry.material + "_" + entry.material, MetaItems.BRANCHCUTTER.getStackForm(entry.material, entry.material), "PfP", "PdP", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
            ModHandler.addShapedRecipe("knife_" + entry.material + "_" + entry.material, MetaItems.KNIFE.getStackForm(entry.material, entry.material), "fPh", " S ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
            ModHandler.addShapedRecipe("butchknife_" + entry.material + "_" + entry.material, MetaItems.BUTCHERYKNIFE.getStackForm(entry.material, entry.material), "PPf", "PP ", "Sh ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
            ModHandler.addShapedRecipe("soldiron_lv_" + entry.material + "_" + Materials.Rubber, // TODO electric tools
            MetaItems.SOLDERING_IRON_LV.getStackForm(entry.material, Materials.Rubber), "LBf", "Sd ", "P  ", 'B', OreDictUnifier.get(OrePrefix.bolt, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'S', OreDictUnifier.get(OrePrefix.stick, Materials.Iron), 'L', MetaItems.BATTERY_RE_LV_LITHIUM.getStackForm());
        }
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack)

Example 13 with SimpleItemStack

use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.

the class ProcessingWire method registerOre.

public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    ItemStack stack = simpleStack.asItemStack();
    switch(entry.orePrefix) {
        case wireGt01:
            if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable01", OreDictUnifier.get(OrePrefix.cableGt01, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).duration(100).EUt(8).buildAndRegister();
            } else if (entry.material == Materials.RedAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable01", OreDictUnifier.get(OrePrefix.cableGt01, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).duration(100).EUt(8).buildAndRegister();
            } else {
                RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(L)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber)).duration(100).EUt(8).buildAndRegister();
            }
            if (!entry.material.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
                RecipeMap.BENDER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(OreDictUnifier.get(OrePrefix.springSmall, entry.material, 2)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(OreDictUnifier.get(OrePrefix.wireFine, entry.material, 4)).duration(200).EUt(8).buildAndRegister();
                RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.ingot, entry.material)).outputs(GTUtility.copy(GTUtility.copyAmount(2, stack), OreDictUnifier.get(OrePrefix.wireFine, entry.material, 8))).duration(100).EUt(4).buildAndRegister();
                RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.stick, entry.material)).outputs(GTUtility.copy(stack, OreDictUnifier.get(OrePrefix.wireFine, entry.material, 4))).duration(50).EUt(4).buildAndRegister();
            }
            if (!entry.material.hasFlag(DustMaterial.MatFlags.NO_WORKING)) {
                ModHandler.addShapedRecipe(entry.material + "_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material), "Xx", 'X', OreDictUnifier.get(OrePrefix.plate, entry.material));
            }
            RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(2, stack)).circuitMeta(2).outputs(OreDictUnifier.get(OrePrefix.wireGt02, entry.material)).duration(150).EUt(8).buildAndRegister();
            RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(4, stack)).circuitMeta(4).outputs(OreDictUnifier.get(OrePrefix.wireGt04, entry.material)).duration(200).EUt(8).buildAndRegister();
            RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(8, stack)).circuitMeta(8).outputs(OreDictUnifier.get(OrePrefix.wireGt08, entry.material)).duration(300).EUt(8).buildAndRegister();
            RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(12, stack)).circuitMeta(12).outputs(OreDictUnifier.get(OrePrefix.wireGt12, entry.material)).duration(400).EUt(8).buildAndRegister();
            RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(16, stack)).circuitMeta(16).outputs(OreDictUnifier.get(OrePrefix.wireGt16, entry.material)).duration(500).EUt(8).buildAndRegister();
            break;
        case wireGt02:
            if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable02", OreDictUnifier.get(OrePrefix.cableGt02, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).duration(100).EUt(8).buildAndRegister();
            } else if (entry.material == Materials.RedAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable02", OreDictUnifier.get(OrePrefix.cableGt02, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).duration(100).EUt(8).buildAndRegister();
            } else {
                RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(L)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber)).duration(100).EUt(8).buildAndRegister();
            }
            ModHandler.addShapelessRecipe(entry.material + "_wire02_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 2), entry);
            ModHandler.addShapelessRecipe(entry.material + "_wire01_t_wire02", GTUtility.copyAmount(1, stack), new UnificationEntry(OrePrefix.wireGt01, entry.material), new UnificationEntry(OrePrefix.wireGt01, entry.material));
            break;
        case wireGt04:
            if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable04", OreDictUnifier.get(OrePrefix.cableGt04, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 2, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 2, 15)).duration(100).EUt(8).buildAndRegister();
            } else if (entry.material == Materials.RedAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_t_cable04", OreDictUnifier.get(OrePrefix.cableGt04, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 2)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 2)).duration(100).EUt(8).buildAndRegister();
            } else {
                RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(2 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 2)).duration(100).EUt(8).buildAndRegister();
            }
            ModHandler.addShapelessRecipe(entry.material + "_wire04_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 4), entry);
            ModHandler.addShapelessRecipe(entry.material + "_wire02_t_wire04", GTUtility.copyAmount(1, stack), new UnificationEntry(OrePrefix.wireGt02, entry.material), new UnificationEntry(OrePrefix.wireGt02, entry.material));
            break;
        case wireGt08:
            if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_wire08_t_cable08", OreDictUnifier.get(OrePrefix.cableGt08, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 3, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 3, 15)).duration(100).EUt(8).buildAndRegister();
            } else if (entry.material == Materials.RedAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_wire08_t_cable08", OreDictUnifier.get(OrePrefix.cableGt08, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 3)).duration(100).EUt(8).buildAndRegister();
            } else {
                RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(3 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 3)).duration(100).EUt(8).buildAndRegister();
            }
            ModHandler.addShapelessRecipe(entry.material + "_wire08_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 8), entry);
            ModHandler.addShapelessRecipe(entry.material + "_wire04_t_wire08", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt04, entry.material), OreDictUnifier.get(OrePrefix.wireGt04, entry.material));
            break;
        case wireGt12:
            if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_wire12_t_cable12", OreDictUnifier.get(OrePrefix.cableGt12, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 4, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 4, 15)).duration(100).EUt(8).buildAndRegister();
            } else if (entry.material == Materials.RedAlloy) {
                ModHandler.addShapelessRecipe(entry.material + "_wire12_t_cable12", OreDictUnifier.get(OrePrefix.cableGt12, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
                RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 4)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 4)).duration(100).EUt(8).buildAndRegister();
            } else {
                RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(4 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
                RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 4)).duration(100).EUt(8).buildAndRegister();
            }
            ModHandler.addShapelessRecipe(entry.material + "_wire12_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 12), entry);
            ModHandler.addShapelessRecipe(entry.material + "_wire12_t_wire08_04", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt08, entry.material), OreDictUnifier.get(OrePrefix.wireGt04, entry.material));
            break;
        case wireGt16:
            ModHandler.addShapelessRecipe(entry.material + "_wire01_t_wire16", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 16), entry);
            ModHandler.addShapelessRecipe(entry.material + "_wire08_t_wire16", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt08, entry.material), OreDictUnifier.get(OrePrefix.wireGt08, entry.material));
            break;
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack)

Example 14 with SimpleItemStack

use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.

the class OreDictUnifier method getUnificated.

public static ItemStack getUnificated(ItemStack itemStack) {
    if (itemStack.isEmpty())
        return ItemStack.EMPTY;
    UnificationEntry unificationEntry = getUnificationEntry(itemStack);
    if (unificationEntry == null || !stackUnificationItems.containsKey(unificationEntry) || !unificationEntry.orePrefix.isUnificationEnabled)
        return itemStack;
    ArrayList<SimpleItemStack> keys = stackUnificationItems.get(unificationEntry);
    keys.sort(Comparator.comparing(a -> a.item.delegate.name().getResourceDomain()));
    return keys.size() > 0 ? keys.get(0).asItemStack(itemStack.getCount()) : itemStack;
}
Also used : java.util(java.util) CaseFormat(com.google.common.base.CaseFormat) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) M(gregtech.api.GTValues.M) GemMaterial(gregtech.api.unification.material.type.GemMaterial) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) Material(gregtech.api.unification.material.type.Material) MetalMaterial(gregtech.api.unification.material.type.MetalMaterial) ItemMaterialInfo(gregtech.api.unification.stack.ItemMaterialInfo) ItemStack(net.minecraft.item.ItemStack) MaterialStack(gregtech.api.unification.stack.MaterialStack) MinecraftForge(net.minecraftforge.common.MinecraftForge) ImmutableList(com.google.common.collect.ImmutableList) OreDictionary(net.minecraftforge.oredict.OreDictionary) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) OrePrefix(gregtech.api.unification.ore.OrePrefix) DustMaterial(gregtech.api.unification.material.type.DustMaterial) Nullable(javax.annotation.Nullable) Joiner(com.google.common.base.Joiner) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack)

Example 15 with SimpleItemStack

use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.

the class BlockMachine method onBlockActivated.

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    MetaTileEntity metaTileEntity = getMetaTileEntity(worldIn, pos);
    if (metaTileEntity == null)
        return false;
    ItemStack itemInHand = playerIn.getHeldItem(hand);
    if (!itemInHand.isEmpty()) {
        SimpleItemStack simpleItemStack = new SimpleItemStack(itemInHand);
        if (GregTechAPI.screwdriverList.contains(simpleItemStack)) {
            if (GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_SCREWDRIVER_CLICK, true) && metaTileEntity.onScrewdriverClick(playerIn, hand, facing, hitX, hitY, hitZ)) {
                GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_SCREWDRIVER_CLICK, false);
                return true;
            } else
                return false;
        } else if (GregTechAPI.wrenchList.contains(simpleItemStack)) {
            if (GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_WRENCH_CLICK, true) && metaTileEntity.onWrenchClick(playerIn, hand, facing, hitX, hitY, hitZ)) {
                GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_WRENCH_CLICK, false);
                return true;
            } else
                return false;
        }
    }
    return metaTileEntity.onRightClick(playerIn, hand, facing, hitX, hitY, hitZ);
}
Also used : SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) MetaTileEntity(gregtech.api.metatileentity.MetaTileEntity) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack)

Aggregations

SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)28 ItemStack (net.minecraft.item.ItemStack)25 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)11 DustMaterial (gregtech.api.unification.material.type.DustMaterial)9 SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)8 GemMaterial (gregtech.api.unification.material.type.GemMaterial)6 MaterialStack (gregtech.api.unification.stack.MaterialStack)6 Nullable (javax.annotation.Nullable)6 MetalMaterial (gregtech.api.unification.material.type.MetalMaterial)5 ItemMaterialInfo (gregtech.api.unification.stack.ItemMaterialInfo)5 OrePrefix (gregtech.api.unification.ore.OrePrefix)4 CaseFormat (com.google.common.base.CaseFormat)3 Joiner (com.google.common.base.Joiner)3 ImmutableList (com.google.common.collect.ImmutableList)3 M (gregtech.api.GTValues.M)3 FluidMaterial (gregtech.api.unification.material.type.FluidMaterial)3 Material (gregtech.api.unification.material.type.Material)3 java.util (java.util)3 MinecraftForge (net.minecraftforge.common.MinecraftForge)3 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)3