Search in sources :

Example 6 with DustMaterial

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

the class MetaBlocks method createCompressedBlock.

private static void createCompressedBlock(Material[] materials, int index) {
    BlockCompressed block = new BlockCompressed(materials);
    block.setRegistryName("compressed_" + index);
    for (Material material : materials) {
        if (material instanceof DustMaterial)
            COMPRESSED.put((DustMaterial) material, block);
    }
}
Also used : Material(gregtech.api.unification.material.type.Material) DustMaterial(gregtech.api.unification.material.type.DustMaterial) DustMaterial(gregtech.api.unification.material.type.DustMaterial)

Example 7 with DustMaterial

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

the class ProcessingDirtyDust method registerOre.

// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack itemStack) {
    if (entry.material instanceof DustMaterial) {
        DustMaterial material = (DustMaterial) entry.material;
        ItemStack stack = itemStack.asItemStack();
        ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, material);
        if (entry.orePrefix == OrePrefix.dustPure && material.separatedOnto != null) {
            ItemStack separatedStack = OreDictUnifier.get(OrePrefix.dustSmall, material.separatedOnto);
            RecipeMap.ELECTROMAGNETIC_SEPARATOR_RECIPES.recipeBuilder().inputs(stack).outputs(dustStack).chancedOutput(separatedStack, 4000).duration((int) material.separatedOnto.getMass()).EUt(24).buildAndRegister();
        }
        int byProductIndex;
        if (entry.orePrefix == OrePrefix.dustRefined) {
            byProductIndex = 2;
        } else if (entry.orePrefix == OrePrefix.dustPure) {
            byProductIndex = 1;
        } else
            byProductIndex = 0;
        FluidMaterial byproduct = GTUtility.selectItemInList(byProductIndex, material, material.oreByProducts, FluidMaterial.class);
        RecipeBuilder builder = RecipeMap.CENTRIFUGE_RECIPES.recipeBuilder().inputs(stack).outputs(dustStack).duration((int) (material.getMass() * 4)).EUt(24);
        if (byproduct instanceof DustMaterial) {
            builder.outputs(OreDictUnifier.get(OrePrefix.dustTiny, byproduct));
        } else {
            builder.fluidOutputs(byproduct.getFluid(GTValues.L / 9));
        }
        builder.buildAndRegister();
    }
}
Also used : FluidMaterial(gregtech.api.unification.material.type.FluidMaterial) DustMaterial(gregtech.api.unification.material.type.DustMaterial) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack) RecipeBuilder(gregtech.api.recipes.RecipeBuilder)

Aggregations

DustMaterial (gregtech.api.unification.material.type.DustMaterial)7 SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)4 ItemStack (net.minecraft.item.ItemStack)4 Material (gregtech.api.unification.material.type.Material)3 Streams (com.google.common.collect.Streams)2 GregTechAPI (gregtech.api.GregTechAPI)2 BlockMachine (gregtech.api.block.machines.BlockMachine)2 RecipeBuilder (gregtech.api.recipes.RecipeBuilder)2 MetaTileEntityRenderer (gregtech.api.render.MetaTileEntityRenderer)2 Materials (gregtech.api.unification.material.Materials)2 FluidMaterial (gregtech.api.unification.material.type.FluidMaterial)2 SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 StoneType (gregtech.api.unification.ore.StoneType)2 StoneTypes (gregtech.api.unification.ore.StoneTypes)2 ClientProxy (gregtech.common.ClientProxy)2 GraniteVariant (gregtech.common.blocks.BlockGranite.GraniteVariant)2 MineralVariant (gregtech.common.blocks.BlockMineral.MineralVariant)2 ChiselingVariant (gregtech.common.blocks.StoneBlock.ChiselingVariant)2 MetaTileEntities (gregtech.common.metatileentities.MetaTileEntities)2