aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/nei/NEIGTPPConfig.java
blob: 6f0da329943891109320a0ce27a9f6a455fc28ec (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
package gtPlusPlus.nei;

import java.util.Arrays;

import net.minecraft.item.ItemStack;

import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import codechicken.nei.event.NEIRegisterHandlerInfosEvent;
import codechicken.nei.recipe.HandlerInfo;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.enums.Mods;
import gregtech.api.recipe.RecipeMaps;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.recipe.GTPPRecipeMaps;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.GTPPCore;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;

public class NEIGTPPConfig implements IConfigureNEI {

    public static boolean sIsAdded = true;

    @Override
    public synchronized void loadConfig() {
        sIsAdded = false;

        Logger.INFO("NEI Registration: Registering NEI handler for " + DecayableRecipeHandler.mNEIName);
        API.registerRecipeHandler(new DecayableRecipeHandler());
        API.registerUsageHandler(new DecayableRecipeHandler());
        API.addRecipeCatalyst(new ItemStack(ModBlocks.blockDecayablesChest, 1), "GTPP_Decayables");

        Logger.INFO("NEI Registration: Registering NEI handler for " + LFTRSpargingNEIHandler.mNEIName);
        new LFTRSpargingNEIHandler();
        API.addRecipeCatalyst(GregtechItemList.Controller_Sparge_Tower.get(1), "gtpp.recipe.lftr.sparging");

        for (GregtechItemList item : Arrays.asList(
            GregtechItemList.GT4_Electric_Auto_Workbench_LV,
            GregtechItemList.GT4_Electric_Auto_Workbench_MV,
            GregtechItemList.GT4_Electric_Auto_Workbench_HV,
            GregtechItemList.GT4_Electric_Auto_Workbench_EV,
            GregtechItemList.GT4_Electric_Auto_Workbench_IV,
            GregtechItemList.GT4_Electric_Auto_Workbench_LuV,
            GregtechItemList.GT4_Electric_Auto_Workbench_ZPM,
            GregtechItemList.GT4_Electric_Auto_Workbench_UV)) {
            API.addRecipeCatalyst(item.get(1), "crafting", -10);
        }
        // Bronze workbench
        API.removeRecipeCatalyst(ItemUtils.getItemStackFromFQRN("gregtech:gt.blockmachines:31081", 1), "crafting");
        API.removeRecipeCatalyst(ItemUtils.getItemStackFromFQRN("gregtech:gt.blockmachines:31082", 1), "crafting");

        // Moved to its own handler
        API.removeRecipeCatalyst(
            GregtechItemList.Controller_Vacuum_Furnace.get(1),
            GTPPRecipeMaps.chemicalDehydratorRecipes.unlocalizedName);

        // ULV simple washer
        API.removeRecipeCatalyst(
            ItemUtils.getItemStackFromFQRN("gregtech:gt.blockmachines:767", 1),
            GTPPRecipeMaps.simpleWasherRecipes.unlocalizedName);

        // ULV combustion generator
        API.removeRecipeCatalyst(
            ItemUtils.getItemStackFromFQRN("gregtech:gt.blockmachines:960", 1),
            RecipeMaps.dieselFuels.unlocalizedName);

        // ULV gas turbine
        API.removeRecipeCatalyst(
            ItemUtils.getItemStackFromFQRN("gregtech:gt.blockmachines:961", 1),
            RecipeMaps.gasTurbineFuels.unlocalizedName);

        // Hide Flasks
        if (Utils.isClient()) {
            API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_8k.get(1));
            API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_32k.get(1));
        }
        sIsAdded = true;
    }

    @SubscribeEvent
    public void registerHandlerInfo(NEIRegisterHandlerInfosEvent event) {
        event.registerHandlerInfo(
            new HandlerInfo.Builder("gtpp.recipe.lftr.sparging", GTPPCore.name, Mods.GTPlusPlus.ID)
                .setDisplayStack(GregtechItemList.Controller_Sparge_Tower.get(1))
                .setShiftY(6)
                .setHeight(135)
                .setMaxRecipesPerPage(1)
                .build());
    }

    @Override
    public String getName() {
        return "GT++ NEI Plugin";
    }

    @Override
    public String getVersion() {
        return "(1.12)";
    }
}