aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtneioreplugin/plugin/IMCForNEI.java
blob: 620140c63010f1d9a4fb56477441fc4e09c1eb9e (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
package gtneioreplugin.plugin;

import net.minecraft.nbt.NBTTagCompound;

import cpw.mods.fml.common.event.FMLInterModComms;
import gtneioreplugin.GTNEIOrePlugin;

public class IMCForNEI {

    public static void IMCSender() {
        // Though these 2 are already registered in NEI jar, we need to re-register
        // because new DimensionDisplayItems made tabs a bit taller.
        sendHandler("gregtech5.plugin.gtneioreplugin.PluginGT5VeinStat", "gregtech:gt.blockores:386");

        sendHandler("gregtech5.plugin.gtneioreplugin.PluginGT5SmallOreStat", "gregtech:gt.blockores:85");

        sendHandler("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.metaitem.01:32619");
        sendCatalyst("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.blockmachines:1157");
        sendCatalyst("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.blockmachines:141");
        sendCatalyst("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.blockmachines:142");
        sendCatalyst("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.blockmachines:149");
        sendCatalyst("gregtech5.plugin.gtneioreplugin.PluginGT5UndergroundFluid", "gregtech:gt.blockmachines:148");
    }

    private static void sendHandler(String name, String itemStack) {
        NBTTagCompound aNBT = new NBTTagCompound();
        aNBT.setString("handler", name);
        aNBT.setString("modName", GTNEIOrePlugin.NAME);
        aNBT.setString("modId", GTNEIOrePlugin.MODID);
        aNBT.setBoolean("modRequired", true);
        aNBT.setString("itemName", itemStack);
        aNBT.setInteger("handlerHeight", 160);
        aNBT.setInteger("handlerWidth", 166);
        aNBT.setInteger("maxRecipesPerPage", 2);
        aNBT.setInteger("yShift", 0);
        FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT);
    }

    @SuppressWarnings("SameParameterValue")
    private static void sendCatalyst(String name, String itemStack, int priority) {
        NBTTagCompound aNBT = new NBTTagCompound();
        aNBT.setString("handlerID", name);
        aNBT.setString("itemName", itemStack);
        aNBT.setInteger("priority", priority);
        FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT);
    }

    @SuppressWarnings("SameParameterValue")
    private static void sendCatalyst(String name, String itemStack) {
        sendCatalyst(name, itemStack, 0);
    }
}