aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/loaders/oreprocessing/ProcessingArrows.java
blob: a66d17293f3c07387feb2ec2a52121b8be74138e (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package gregtech.loaders.oreprocessing;

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.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.ItemStack;

public class ProcessingArrows implements gregtech.api.interfaces.IOreRecipeRegistrator {
    public ProcessingArrows() {
        OrePrefixes.arrowGtWood.add(this);
        OrePrefixes.arrowGtPlastic.add(this);
    }

    @Override
    public void registerOre(
            OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
        ItemStack tOutput = GT_Utility.copyAmount(1L, aStack);
        GT_Utility.updateItemStack(tOutput);
        GT_Utility.ItemNBT.addEnchantment(
                tOutput,
                Enchantment.smite,
                EnchantmentHelper.getEnchantmentLevel(Enchantment.smite.effectId, tOutput) + 3);
        GT_Values.RA.addChemicalBathRecipe(
                GT_Utility.copyAmount(1L, aStack),
                Materials.HolyWater.getFluid(25L),
                tOutput,
                null,
                null,
                null,
                100,
                2);

        tOutput = GT_Utility.copyAmount(1L, aStack);
        GT_Utility.updateItemStack(tOutput);
        GT_Utility.ItemNBT.addEnchantment(
                tOutput,
                Enchantment.fireAspect,
                EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, tOutput) + 3);
        GT_Values.RA.addChemicalBathRecipe(
                GT_Utility.copyAmount(1L, aStack),
                Materials.FierySteel.getFluid(25L),
                tOutput,
                null,
                null,
                null,
                100,
                2);

        tOutput = GT_Utility.copyAmount(1L, aStack);
        GT_Utility.updateItemStack(tOutput);
        GT_Utility.ItemNBT.addEnchantment(
                tOutput,
                Enchantment.fireAspect,
                EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, tOutput) + 1);
        GT_Values.RA.addChemicalBathRecipe(
                GT_Utility.copyAmount(1L, aStack), Materials.Blaze.getMolten(18L), tOutput, null, null, null, 100, 2);

        tOutput = GT_Utility.copyAmount(1L, aStack);
        GT_Utility.updateItemStack(tOutput);
        GT_Utility.ItemNBT.addEnchantment(
                tOutput,
                Enchantment.knockback,
                EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, tOutput) + 1);
        GT_Values.RA.addChemicalBathRecipe(
                GT_Utility.copyAmount(1L, aStack), Materials.Rubber.getMolten(18L), tOutput, null, null, null, 100, 2);

        tOutput = GT_Utility.copyAmount(1L, aStack);
        GT_Utility.updateItemStack(tOutput);
        GT_Utility.ItemNBT.addEnchantment(
                tOutput,
                gregtech.api.enchants.Enchantment_EnderDamage.INSTANCE,
                EnchantmentHelper.getEnchantmentLevel(
                                gregtech.api.enchants.Enchantment_EnderDamage.INSTANCE.effectId, tOutput)
                        + 1);
        GT_Values.RA.addChemicalBathRecipe(
                GT_Utility.copyAmount(1L, aStack), Materials.Mercury.getFluid(25L), tOutput, null, null, null, 100, 2);

        if ((aMaterial.mUnificatable)
                && (aMaterial.mMaterialInto == aMaterial)
                && !aMaterial.contains(SubTag.NO_WORKING)) {
            switch (aPrefix) {
                case arrowGtWood:
                    GT_ModHandler.addCraftingRecipe(
                            GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, aMaterial, 1L),
                            GT_Proxy.tBits,
                            new Object[] {
                                "  A",
                                " S ",
                                "F  ",
                                'S',
                                OrePrefixes.stick.get(Materials.Wood),
                                'F',
                                OreDictNames.craftingFeather,
                                'A',
                                OrePrefixes.toolHeadArrow.get(aMaterial)
                            });
                case arrowGtPlastic:
                    GT_ModHandler.addCraftingRecipe(
                            GT_OreDictUnificator.get(OrePrefixes.arrowGtPlastic, aMaterial, 1L),
                            GT_Proxy.tBits,
                            new Object[] {
                                "  A",
                                " S ",
                                "F  ",
                                'S',
                                OrePrefixes.stick.get(Materials.Plastic),
                                'F',
                                OreDictNames.craftingFeather,
                                'A',
                                OrePrefixes.toolHeadArrow.get(aMaterial)
                            });
                default:
                    break;
            }
        }
    }
}