aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/loaders/oreprocessing/ProcessingScrew.java
blob: 46823941998154ab314ff30bf0f22b798cdd468e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gregtech.loaders.oreprocessing;

import static gregtech.api.util.GT_Utility.calculateRecipeEU;

import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Proxy;
import net.minecraft.item.ItemStack;

public class ProcessingScrew implements gregtech.api.interfaces.IOreRecipeRegistrator {
    public ProcessingScrew() {
        OrePrefixes.screw.add(this);
    }

    @Override
    public void registerOre(
            OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
        if (!aMaterial.contains(SubTag.NO_WORKING)) {
            GT_Values.RA.addLatheRecipe(
                    GT_OreDictUnificator.get(OrePrefixes.bolt, aMaterial, 1L),
                    GT_Utility.copyAmount(1L, aStack),
                    null,
                    (int) Math.max(aMaterial.getMass() / 8L, 1L),
                    calculateRecipeEU(aMaterial, 4));
            if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial))
                if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) {
                    GT_ModHandler.addCraftingRecipe(
                            GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L),
                            GT_Proxy.tBits,
                            new Object[] {"fX", "X ", 'X', OrePrefixes.bolt.get(aMaterial)});
                }
        }
    }
}