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