Search in sources :

Example 1 with GemMaterial

use of gregtech.api.unification.material.type.GemMaterial in project GregTech by GregTechCE.

the class ProcessingCrushedPurified method registerOre.

// public static void register() {
// OrePrefix.crushedPurified.addProcessingHandler(new ProcessingCrushedPurified());
// }
// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack itemStack) {
    if (entry.material instanceof SolidMaterial) {
        ItemStack crushedPurifiedStack = itemStack.asItemStack();
        SolidMaterial solidMaterial = (SolidMaterial) entry.material;
        ItemStack crushedCentrifugedStack = OreDictUnifier.get(OrePrefix.crushedCentrifuged, solidMaterial);
        ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, solidMaterial);
        ItemStack byproductStack = OreDictUnifier.get(OrePrefix.dustTiny, GTUtility.selectItemInList(1, solidMaterial, solidMaterial.oreByProducts, DustMaterial.class));
        if (!crushedCentrifugedStack.isEmpty()) {
            RecipeMap.THERMAL_CENTRIFUGE_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).outputs(crushedCentrifugedStack, byproductStack).duration((int) (entry.material.getMass() * 20)).EUt(60).buildAndRegister();
        } else {
            RecipeMap.THERMAL_CENTRIFUGE_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).outputs(dustStack, byproductStack).duration((int) (entry.material.getMass() * 20)).EUt(60).buildAndRegister();
        }
        if (entry.material instanceof GemMaterial) {
            ItemStack exquisiteStack = OreDictUnifier.get(OrePrefix.gemExquisite, entry.material);
            ItemStack flawlessStack = OreDictUnifier.get(OrePrefix.gemFlawless, entry.material);
            ItemStack gemStack = OreDictUnifier.get(OrePrefix.gem, entry.material);
            ItemStack flawedStack = OreDictUnifier.get(OrePrefix.gemFlawed, entry.material);
            ItemStack chippedStack = OreDictUnifier.get(OrePrefix.gemChipped, entry.material);
            if (entry.material.hasFlag(GemMaterial.MatFlags.HIGH_SIFTER_OUTPUT)) {
                RecipeMap.SIFTER_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).chancedOutput(exquisiteStack, 300).chancedOutput(flawlessStack, 1200).chancedOutput(gemStack, 4500).chancedOutput(flawedStack, 1400).chancedOutput(chippedStack, 2800).chancedOutput(dustStack, 3500).duration(800).EUt(16).buildAndRegister();
            } else {
                RecipeMap.SIFTER_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).chancedOutput(exquisiteStack, 100).chancedOutput(flawlessStack, 400).chancedOutput(gemStack, 1500).chancedOutput(flawedStack, 2000).chancedOutput(chippedStack, 4000).chancedOutput(dustStack, 5000).duration(800).EUt(16).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) GemMaterial(gregtech.api.unification.material.type.GemMaterial)

Example 2 with GemMaterial

use of gregtech.api.unification.material.type.GemMaterial 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 3 with GemMaterial

use of gregtech.api.unification.material.type.GemMaterial 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)

Aggregations

GemMaterial (gregtech.api.unification.material.type.GemMaterial)3 SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)3 ItemStack (net.minecraft.item.ItemStack)3 DustMaterial (gregtech.api.unification.material.type.DustMaterial)1 MarkerMaterial (gregtech.api.unification.material.type.MarkerMaterial)1 SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)1 OrePrefix (gregtech.api.unification.ore.OrePrefix)1 EnumDyeColor (net.minecraft.item.EnumDyeColor)1