mirror of
https://github.com/GTNewHorizons/Advanced-Botany.git
synced 2026-11-13 17:04:09 +00:00
Add catalyst to NEI
This commit is contained in:
1 parent
57e1e24281
commit
d186229c8d
3 files changed
+87
No files matched your search
@@ -10,6 +10,7 @@ import ab.common.lib.register.EntityListAB;
|
||||
import ab.common.lib.register.FlowerRegister;
|
||||
import ab.common.lib.register.ItemListAB;
|
||||
import ab.common.minetweaker.MineTweakerConfig;
|
||||
import ab.nei.*;
|
||||
import ab.utils.CraftingManager;
|
||||
import ab.utils.ModHelperManager;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -34,6 +35,7 @@ public class CommonProxy {
|
||||
public void init(FMLInitializationEvent event) {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(AdvancedBotany.instance, new GuiHandler());
|
||||
NetworkHandler.registerPackets();
|
||||
IMCForNEI.IMCSender();
|
||||
ModHelperManager.init();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package ab.nei;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class IMCForNEI {
|
||||
|
||||
public static void IMCSender() {
|
||||
sendHandler("ab.client.nei.RecipeHandlerAlphirine", "Botania:lexicon");
|
||||
sendCatalyst("ab.client.nei.RecipeHandlerAlphirine", "Botania:lexicon");
|
||||
|
||||
sendHandler("ab.client.nei.RecipeHandlerAdvancedPlate", "AdvancedBotany:blockABPlate");
|
||||
sendCatalyst("ab.client.nei.RecipeHandlerAdvancedPlate", "AdvancedBotany:blockABPlate");
|
||||
|
||||
}
|
||||
|
||||
private static void sendHandler(String aName, String aBlock) {
|
||||
sendHandler(aName, aBlock, 1);
|
||||
}
|
||||
|
||||
private static void sendHandler(String aName, String aBlock, int maxRecipesPerPage) {
|
||||
NBTTagCompound aNBT = new NBTTagCompound();
|
||||
aNBT.setString("handler", aName);
|
||||
aNBT.setString("modName", "Advanced Botany");
|
||||
aNBT.setString("modId", "AdvancedBotany");
|
||||
aNBT.setBoolean("modRequired", true);
|
||||
aNBT.setString("itemName", aBlock);
|
||||
aNBT.setInteger("handlerHeight", 135);
|
||||
aNBT.setInteger("handlerWidth", 166);
|
||||
aNBT.setInteger("maxRecipesPerPage", maxRecipesPerPage);
|
||||
aNBT.setInteger("yShift", 6);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT);
|
||||
}
|
||||
|
||||
private static void sendCatalyst(String aName, String aStack, int aPriority) {
|
||||
NBTTagCompound aNBT = new NBTTagCompound();
|
||||
aNBT.setString("handlerID", aName);
|
||||
aNBT.setString("itemName", aStack);
|
||||
aNBT.setInteger("priority", aPriority);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT);
|
||||
}
|
||||
|
||||
private static void sendCatalyst(String aName, String aStack) {
|
||||
sendCatalyst(aName, aStack, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package ab.nei;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import ab.AdvancedBotany;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
|
||||
public class NEI_Config implements IConfigureNEI {
|
||||
|
||||
public static boolean isAdded = true;
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
NEI_Config.isAdded = false;
|
||||
NEI_Config.isAdded = true;
|
||||
}
|
||||
|
||||
public static void hide(Block aBlock) {
|
||||
API.hideItem(new ItemStack(aBlock, 1));
|
||||
}
|
||||
|
||||
public static void hide(Item aItem) {
|
||||
API.hideItem(new ItemStack(aItem, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Advanced Botany NEI Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return AdvancedBotany.version;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user