Search in sources :

Example 11 with IngotMaterial

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

the class RecyclingRecipes method getArcSmeltingResult.

private static ItemStack getArcSmeltingResult(MaterialStack materialStack) {
    DustMaterial material = (DustMaterial) materialStack.material;
    long materialAmount = materialStack.amount;
    if (material.hasFlag(MatFlags.FLAMMABLE)) {
        return OreDictUnifier.getDust(Materials.Ash, materialAmount);
    } else if (material instanceof GemMaterial) {
        if (materialStack.material.materialComponents.stream().anyMatch(stack -> stack.material == Materials.Oxygen)) {
            return OreDictUnifier.getDust(Materials.Ash, materialAmount);
        }
        if (materialStack.material.materialComponents.stream().anyMatch(stack -> stack.material == Materials.Carbon)) {
            return OreDictUnifier.getDust(Materials.Carbon, materialAmount);
        }
        return OreDictUnifier.getDust(Materials.DarkAsh, materialAmount);
    } else if (material instanceof IngotMaterial) {
        IngotMaterial ingotMaterial = (IngotMaterial) material;
        if (ingotMaterial.arcSmeltInto != null)
            ingotMaterial = ingotMaterial.arcSmeltInto;
        return OreDictUnifier.getIngot(ingotMaterial, materialAmount);
    } else {
        return OreDictUnifier.getDust(material, materialAmount);
    }
}
Also used : OreDictUnifier(gregtech.api.unification.OreDictUnifier) M(gregtech.api.GTValues.M) L(gregtech.api.GTValues.L) GemMaterial(gregtech.api.unification.material.type.GemMaterial) IngotMaterial(gregtech.api.unification.material.type.IngotMaterial) Materials(gregtech.api.unification.material.Materials) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) ItemMaterialInfo(gregtech.api.unification.stack.ItemMaterialInfo) ItemStack(net.minecraft.item.ItemStack) MaterialStack(gregtech.api.unification.stack.MaterialStack) List(java.util.List) RecipeBuilder(gregtech.api.recipes.RecipeBuilder) MatFlags(gregtech.api.unification.material.type.Material.MatFlags) Entry(java.util.Map.Entry) RecipeMaps(gregtech.api.recipes.RecipeMaps) DustMaterial(gregtech.api.unification.material.type.DustMaterial) IngotMaterial(gregtech.api.unification.material.type.IngotMaterial) DustMaterial(gregtech.api.unification.material.type.DustMaterial) GemMaterial(gregtech.api.unification.material.type.GemMaterial)

Aggregations

IngotMaterial (gregtech.api.unification.material.type.IngotMaterial)11 MaterialStack (gregtech.api.unification.stack.MaterialStack)5 ItemStack (net.minecraft.item.ItemStack)5 DustMaterial (gregtech.api.unification.material.type.DustMaterial)4 Materials (gregtech.api.unification.material.Materials)3 Material (gregtech.api.unification.material.type.Material)3 SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)3 ArrayList (java.util.ArrayList)3 L (gregtech.api.GTValues.L)2 M (gregtech.api.GTValues.M)2 RecipeBuilder (gregtech.api.recipes.RecipeBuilder)2 RecipeMaps (gregtech.api.recipes.RecipeMaps)2 IntCircuitIngredient (gregtech.api.recipes.ingredients.IntCircuitIngredient)2 OreDictUnifier (gregtech.api.unification.OreDictUnifier)2 GemMaterial (gregtech.api.unification.material.type.GemMaterial)2 MatFlags (gregtech.api.unification.material.type.Material.MatFlags)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 ItemMaterialInfo (gregtech.api.unification.stack.ItemMaterialInfo)2 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)2 List (java.util.List)2