Search in sources :

Example 6 with SimpleItemStack

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

the class ProcessingGem method registerOre.

public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material instanceof GemMaterial) {
        GemMaterial material = (GemMaterial) entry.material;
        ItemStack stack = simpleStack.asItemStack();
        long materialAmount = entry.orePrefix.materialAmount;
        ItemStack crushedStack = OreDictUnifier.getDust(material, materialAmount);
        if (material.hasFlag(SolidMaterial.MatFlags.MORTAR_GRINDABLE)) {
            ModHandler.addShapelessRecipe("gem_t_dust_" + material, crushedStack, "m", stack);
        }
        if (!material.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
            OrePrefix prevPrefix = GTUtility.getItem(ORDER, ORDER.indexOf(entry.orePrefix) - 1, null);
            if (prevPrefix != null) {
                ItemStack prevStack = OreDictUnifier.get(prevPrefix, material, 2);
                ModHandler.addShapelessRecipe("gem_t_gem_" + material, prevStack, "h", stack);
                RecipeMap.HAMMER_RECIPES.recipeBuilder().inputs(stack).outputs(prevStack).duration(20).EUt(16).buildAndRegister();
            }
        }
        if (!material.hasFlag(DustMaterial.MatFlags.NO_WORKING)) {
            if (material.hasFlag(SolidMaterial.MatFlags.GENERATE_LONG_ROD) && materialAmount >= M * 2) {
                RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.stickLong, material, (int) (materialAmount / (M * 2))), OreDictUnifier.getDust(material, materialAmount % (M * 2))).duration((int) material.getMass()).EUt(16).buildAndRegister();
            } else if (materialAmount >= M) {
                RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.stick, material, (int) (materialAmount / M)), OreDictUnifier.getDust(material, materialAmount % M)).duration((int) material.getMass()).EUt(16).buildAndRegister();
            }
        }
    }
}
Also used : OrePrefix(gregtech.api.unification.ore.OrePrefix) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack) GemMaterial(gregtech.api.unification.material.type.GemMaterial)

Example 7 with SimpleItemStack

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

the class ProcessingLens method registerOre.

// public static void register() {
// OrePrefix.lens.addProcessingHandler(new ProcessingLens());
// }
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material instanceof GemMaterial) {
        ItemStack stack = simpleStack.asItemStack();
        RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.plate, entry.material)).outputs(stack, OreDictUnifier.get(OrePrefix.dustSmall, entry.material)).duration((int) (entry.material.getMass() / 2L)).EUt(16).buildAndRegister();
        EnumDyeColor dyeColor = GTUtility.determineDyeColor(entry.material.materialRGB);
        MarkerMaterial colorMaterial = MarkerMaterials.Color.COLORS.get(dyeColor);
        OreDictUnifier.registerOre(stack, OrePrefix.craftingLens, colorMaterial);
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) EnumDyeColor(net.minecraft.item.EnumDyeColor) GemMaterial(gregtech.api.unification.material.type.GemMaterial) MarkerMaterial(gregtech.api.unification.material.type.MarkerMaterial)

Example 8 with SimpleItemStack

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

the class ProcessingLog method registerOre.

// public static void register() {
// OrePrefix.log.addProcessingHandler(new ProcessingLog());
// }
// 
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    ItemStack stack = simpleStack.asItemStack();
    RecipeMap.MACERATOR_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.dust, Materials.Wood, 6)).chancedOutput(OreDictUnifier.get(OrePrefix.dust, Materials.Wood), 8000).buildAndRegister();
    ModHandler.addShapedRecipe("stick_long_" + entry.material, OreDictUnifier.get(OrePrefix.stickLong, Materials.Wood, 2), "sLf", 'L', entry);
    RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.stickLong, Materials.Wood, 4), OreDictUnifier.get(OrePrefix.dust, Materials.Wood, 2)).duration(160).EUt(8).buildAndRegister();
    ItemStack smeltingOutput = ModHandler.getSmeltingOutput(stack);
    if (!smeltingOutput.isEmpty() && smeltingOutput.getItem() == Items.COAL && smeltingOutput.getMetadata() == 1) {
        int coalAmount = smeltingOutput.getCount();
        RecipeMap.PYROLYSE_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(16, stack)).circuitMeta(0).outputs(new ItemStack(Items.COAL, 20 * coalAmount, 1)).fluidOutputs(Materials.Creosote.getFluid(5000 * coalAmount)).duration(440).EUt(64).buildAndRegister();
        RecipeMap.PYROLYSE_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(16, stack)).circuitMeta(1).fluidInputs(Materials.Nitrogen.getFluid(400)).outputs(new ItemStack(Items.COAL, 20, 1)).fluidInputs(Materials.Creosote.getFluid(4000)).duration(200).EUt(96).buildAndRegister();
        RecipeMap.PYROLYSE_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(16, stack)).circuitMeta(2).outputs(OreDictUnifier.get(OrePrefix.dust, Materials.Ash, 5)).fluidOutputs(Materials.OilHeavy.getFluid(300)).duration(280).EUt(192).buildAndRegister();
    }
    ItemStack output = ModHandler.getRecipeOutput(GTValues.DW, stack);
    if (!output.isEmpty() && OreDictUnifier.getPrefix(output) == OrePrefix.plank) {
        RecipeMap.CUTTER_RECIPES.recipeBuilder().inputs(stack).fluidInputs(Materials.Lubricant.getFluid(1)).outputs(GTUtility.copyAmount(output.getCount() * 2, stack), OreDictUnifier.get(OrePrefix.dust, Materials.Wood)).duration(200).EUt(8).buildAndRegister();
        RecipeMap.CUTTER_RECIPES.recipeBuilder().inputs(stack).outputs(output, OreDictUnifier.get(OrePrefix.dust, Materials.Wood, 2)).duration(200).EUt(8).buildAndRegister();
        ModHandler.removeRecipes(output);
        ModHandler.addShapedRecipe("log_t_wood_" + entry.material, GTUtility.copyAmount(output.getCount(), output), "s##", "L##", 'L', stack);
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack)

Example 9 with SimpleItemStack

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

the class ProcessingPlate method registerOre.

public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    ItemStack stack = simpleStack.asItemStack();
    boolean noSmashing = entry.material.hasFlag(NO_SMASHING);
    long materialMass = entry.material.getMass();
    switch(entry.orePrefix) {
        case plate:
            if (entry.material instanceof FluidMaterial) {
                RecipeMap.FLUID_SOLIDFICATION_RECIPES.recipeBuilder().notConsumable(MetaItems.SHAPE_MOLD_PLATE).fluidInputs(((FluidMaterial) entry.material).getFluid(L)).outputs(OreDictUnifier.get(OrePrefix.plate, entry.material)).duration(32).EUt(8).buildAndRegister();
            }
            RecipeMap.IMPLOSION_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(2, stack)).explosivesAmount(2).outputs(OreDictUnifier.get(OrePrefix.compressed, entry.material), OreDictUnifier.get(OrePrefix.dustTiny, Materials.DarkAsh)).buildAndRegister();
            if (entry.material == Materials.Paper)
                ModHandler.addShapedRecipe("papar_f_scane_" + entry.material, GTUtility.copyAmount(3, stack), "XXX", 'X', new ItemStack(Items.REEDS, 1, W));
            if (!noSmashing) {
                ModHandler.addShapedRecipe("ingot_t_plate_" + entry.material, OreDictUnifier.get(OrePrefix.plate, entry.material), "h", "X", "X", 'X', new UnificationEntry(OrePrefix.ingot, entry.material));
                ModHandler.addShapedRecipe("ingot_t_plate_od_" + entry.material, OreDictUnifier.get(OrePrefix.plate, entry.material), "H", "X", 'H', ToolDictNames.craftingToolForgeHammer, 'X', new UnificationEntry(OrePrefix.ingot, entry.material));
                ModHandler.addShapedRecipe("gem_t_plate_" + entry.material, OreDictUnifier.get(OrePrefix.plate, entry.material), "h", "X", 'X', new UnificationEntry(OrePrefix.gem, entry.material));
                ModHandler.addShapedRecipe("gem_t_plate_od_" + entry.material, OreDictUnifier.get(OrePrefix.plate, entry.material), "H", "X", 'H', ToolDictNames.craftingToolForgeHammer, 'X', new UnificationEntry(OrePrefix.gem, entry.material));
            }
            if (entry.material.hasFlag(MORTAR_GRINDABLE))
                ModHandler.addShapedRecipe("plate_t_dust_" + entry.material, OreDictUnifier.get(OrePrefix.dust, entry.material), "X", "m", 'X', new UnificationEntry(OrePrefix.plate, entry.material));
            break;
        case plateDense:
            if (!noSmashing) {
                RecipeMap.BENDER_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.plate, entry.material, 9)).outputs(GTUtility.copyAmount(1, stack)).duration((int) Math.max(materialMass * 9L, 1L)).EUt(96).buildAndRegister();
            }
            break;
    }
}
Also used : FluidMaterial(gregtech.api.unification.material.type.FluidMaterial) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack)

Example 10 with SimpleItemStack

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

the class ProcessingPolarizing method registerOre.

public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material instanceof MetalMaterial) {
        MetalMaterial material = (MetalMaterial) entry.material;
        ItemStack stack = simpleStack.asItemStack();
        if (material.magneticMaterial != null) {
            ItemStack magneticStack = OreDictUnifier.get(entry.orePrefix, material.magneticMaterial);
            // polarizing
            RecipeMap.POLARIZER_RECIPES.recipeBuilder().inputs(stack).outputs(magneticStack).duration(16).EUt(16).buildAndRegister();
            // de-magnetizing
            ModHandler.addSmeltingRecipe(magneticStack, stack);
        }
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) MetalMaterial(gregtech.api.unification.material.type.MetalMaterial)

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