Merge pull request #1452 from 70000hp/aaargh

Aaargh
This commit is contained in:
HbmMods 2024-04-21 18:19:32 +02:00 committed by GitHub
commit 92fd9014a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 486 additions and 94 deletions

View File

@ -0,0 +1,14 @@
package com.hbm.handler.imc;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
public interface ICompatNHNEI {
/**First item on the list is the icon for the recipe in the NEI GUI, the rest are displayed on the sidebar
* as other items that can be used for the same purpose**/
ItemStack[] getMachinesForRecipe();
String getRecipeID();
}

View File

@ -0,0 +1,66 @@
package com.hbm.handler.imc;
import codechicken.nei.recipe.TemplateRecipeHandler;
import com.hbm.config.VersatileConfig;
import com.hbm.handler.nei.*;
import com.hbm.lib.RefStrings;
import com.hbm.main.NEIConfig;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.ArrayList;
import static com.hbm.main.ClientProxy.handlerList;
public class IMCHandlerNHNEI {
public static void IMCSender() {
for (TemplateRecipeHandler handler: handlerList()) {
Class<? extends TemplateRecipeHandler> handlerClass = handler.getClass();
if(handler instanceof ICompatNHNEI && ((ICompatNHNEI) handler).getMachinesForRecipe() != null) {
String blockName = "hbm:" + ((ICompatNHNEI) handler).getMachinesForRecipe()[0].getUnlocalizedName();
String hClass = handlerClass.getName();
sendHandler(hClass, ((ICompatNHNEI) handler).getRecipeID(), blockName);
for (ItemStack stack: ((ICompatNHNEI) handler).getMachinesForRecipe()) {
sendCatalyst(hClass, "hbm:" + stack.getUnlocalizedName());
}
}
}
}
private static void sendHandler(String aName, String handlerID, String aBlock) {
sendHandler(aName, handlerID, aBlock, 3);
}
private static void sendHandler(String aName, String handlerID, String aBlock, int maxRecipesPerPage) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handler", aName);
aNBT.setString("handlerID", handlerID);
aNBT.setString("modName", RefStrings.NAME);
aNBT.setString("modId", RefStrings.MODID);
aNBT.setBoolean("modRequired", true);
aNBT.setString("itemName", aBlock);
aNBT.setInteger("handlerHeight", 65);
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("catalystHandlerID", 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);
}
}

View File

@ -7,6 +7,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIDiFurnace;
import com.hbm.inventory.recipes.BlastFurnaceRecipes;
import com.hbm.inventory.recipes.MachineRecipes;
@ -17,10 +19,22 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class AlloyFurnaceRecipeHandler extends TemplateRecipeHandler {
public class AlloyFurnaceRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public static ArrayList<Fuel> fuels;
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_difurnace_off),
new ItemStack(ModBlocks.machine_difurnace_rtg_off)};
}
@Override
public String getRecipeID() {
return "alloysmelting";
}
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input1;
PositionedStack input2;

View File

@ -7,7 +7,9 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.NTMAnvil;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.gui.GUIAnvil;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
@ -24,7 +26,29 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class AnvilRecipeHandler extends TemplateRecipeHandler {
public class AnvilRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.anvil_iron),
new ItemStack(ModBlocks.anvil_lead),
new ItemStack(ModBlocks.anvil_steel),
new ItemStack(ModBlocks.anvil_desh),
new ItemStack(ModBlocks.anvil_saturnite),
new ItemStack(ModBlocks.anvil_ferrouranium),
new ItemStack(ModBlocks.anvil_bismuth_bronze),
new ItemStack(ModBlocks.anvil_arsenic_bronze),
new ItemStack(ModBlocks.anvil_schrabidate),
new ItemStack(ModBlocks.anvil_dnt),
new ItemStack(ModBlocks.anvil_osmiridium),
new ItemStack(ModBlocks.anvil_murky)};
}
@Override
public String getRecipeID() {
return "ntmAnvil";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();

View File

@ -6,6 +6,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.gui.GUIMachineAssembler;
import com.hbm.inventory.recipes.AssemblerRecipes;
@ -19,13 +21,25 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class AssemblerRecipeHandler extends TemplateRecipeHandler {
public class AssemblerRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_assembler),
new ItemStack(ModBlocks.machine_assemfac)};
}
@Override
public String getRecipeID() {
return "assembly";
}
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
List<PositionedStack> input;

View File

@ -4,6 +4,8 @@ import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
@ -14,12 +16,22 @@ import com.hbm.inventory.recipes.MagicRecipes.MagicRecipe;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import com.hbm.items.ModItems;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class BookRecipeHandler extends TemplateRecipeHandler {
public class BookRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModItems.book_of_)};
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
@Override
public String getRecipeID() {
return "book_of_boxcars";
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
List<PositionedStack> input;
PositionedStack result;

View File

@ -5,6 +5,8 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIMachineReactorBreeding;
import com.hbm.inventory.recipes.BreederRecipes;
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
@ -16,8 +18,18 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class BreederRecipeHandler extends TemplateRecipeHandler {
public class BreederRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_reactor_breeding)};
}
@Override
public String getRecipeID() {
return "breeding";
}
public class BreedingSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;

View File

@ -5,6 +5,8 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.gui.GUIMachineChemplant;
@ -20,14 +22,26 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class ChemplantRecipeHandler extends TemplateRecipeHandler {
public class ChemplantRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_chemplant),
new ItemStack(ModBlocks.machine_chemfac)};
}
@Override
public String getRecipeID() {
return "chemistry";
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack[] itemIn = new PositionedStack[4];
PositionedStack[] fluidIn = new PositionedStack[2];
PositionedStack[] itemOut = new PositionedStack[4];

View File

@ -16,6 +16,14 @@ public class ConstructionHandler extends NEIUniversalHandler {
super("Construction", getRecipes(true), getRecipes(false));
}
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModItems.acetylene_torch),
new ItemStack(ModItems.blowtorch),
new ItemStack(ModItems.boltgun)};
}
@Override
public String getKey() {
return "ntmConstruction";

View File

@ -6,6 +6,7 @@ import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.material.NTMMaterial;
@ -20,7 +21,16 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleAlloyingHandler extends TemplateRecipeHandler {
public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_crucible)};
}
@Override
public String getRecipeID() {
return "ntmCrucibleAlloying";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -6,6 +6,8 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.recipes.CrucibleRecipes;
import com.hbm.items.machine.ItemMold;
@ -17,7 +19,19 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleCastingHandler extends TemplateRecipeHandler {
public class CrucibleCastingHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.foundry_basin),
new ItemStack(ModBlocks.foundry_mold),
new ItemStack(ModBlocks.machine_strand_caster)};
}
@Override
public String getRecipeID() {
return "ntmCrucibleFoundry";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -9,6 +9,7 @@ import java.util.List;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.recipes.CrucibleRecipes;
import com.hbm.lib.RefStrings;
@ -19,8 +20,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleSmeltingHandler extends TemplateRecipeHandler {
public class CrucibleSmeltingHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_crucible)};
}
@Override
public String getRecipeID() {
return "ntmCrucibleSmelting";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -6,6 +6,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIMachineCyclotron;
import com.hbm.inventory.recipes.CyclotronRecipes;
import com.hbm.lib.RefStrings;
@ -16,8 +18,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CyclotronRecipeHandler extends TemplateRecipeHandler {
public class CyclotronRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_cyclotron)};
}
@Override
public String getRecipeID() {
return "cyclotronProcessing";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -5,7 +5,10 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.recipes.MachineRecipes;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
@ -14,7 +17,23 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class FluidRecipeHandler extends TemplateRecipeHandler {
public class FluidRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModItems.fluid_barrel_empty),
new ItemStack(ModItems.fluid_tank_empty),
new ItemStack(ModItems.fluid_tank_lead_empty),
new ItemStack(ModItems.canister_empty),
new ItemStack(ModItems.gas_empty),
new ItemStack(ModItems.cell_empty),
new ItemStack(ModItems.disperser_canister_empty),
new ItemStack(ModItems.glyphid_gland_empty)};
}
@Override
public String getRecipeID() {
return "fluidcons";
}
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe
{

View File

@ -6,6 +6,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIITER;
import com.hbm.inventory.recipes.FusionRecipes;
import com.hbm.lib.RefStrings;
@ -16,8 +18,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class FusionRecipeHandler extends TemplateRecipeHandler {
public class FusionRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.iter)};
}
@Override
public String getRecipeID() {
return "fusion";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -9,6 +9,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIMachineGasCent;
import com.hbm.inventory.recipes.GasCentrifugeRecipes;
import com.hbm.inventory.recipes.MachineRecipes;
@ -22,8 +24,16 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_gascent)};
}
@Override
public String getRecipeID() {
return "gascentprocessing";
}
public static ArrayList<Fuel> fuels;
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {

View File

@ -8,6 +8,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIHadron;
import com.hbm.inventory.recipes.HadronRecipes;
import com.hbm.inventory.recipes.HadronRecipes.HadronRecipe;
@ -21,8 +23,17 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class HadronRecipeHandler extends TemplateRecipeHandler {
public class HadronRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.hadron_core)};
}
@Override
public String getRecipeID() {
return "hadron";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -10,6 +10,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.lib.RefStrings;
import com.hbm.util.InventoryUtil;
@ -21,8 +23,13 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
public abstract class NEIUniversalHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return machine;
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
@ -34,7 +41,6 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
public final HashMap<Object, Object> recipes;
public HashMap<Object, Object> machineOverrides;
/// SETUP ///
public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
this.display = display;
this.machine = machine;
@ -305,4 +311,9 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
}
public abstract String getKey();
@Override
public String getRecipeID() {
return getKey();
}
}

View File

@ -7,6 +7,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.interfaces.Untested;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
@ -25,8 +27,19 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
@Untested
public class PressRecipeHandler extends TemplateRecipeHandler {
public class PressRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_press),
new ItemStack(ModBlocks.machine_epress),
new ItemStack(ModBlocks.machine_conveyor_press)};
}
@Override
public String getRecipeID() {
return "pressing";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -8,6 +8,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIRadiolysis;
import com.hbm.inventory.recipes.RadiolysisRecipes;
import com.hbm.lib.RefStrings;
@ -18,8 +20,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class RadiolysisRecipeHandler extends TemplateRecipeHandler {
public class RadiolysisRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_radiolysis)};
}
@Override
public String getRecipeID() {
return "ntmRadiolysis";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -7,6 +7,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIMachineRefinery;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.lib.RefStrings;
@ -16,8 +18,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class RefineryRecipeHandler extends TemplateRecipeHandler {
public class RefineryRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_refinery)};
}
@Override
public String getRecipeID() {
return "refinery";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -7,6 +7,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUISILEX;
import com.hbm.inventory.recipes.SILEXRecipes;
import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe;
@ -24,8 +26,17 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class SILEXRecipeHandler extends TemplateRecipeHandler {
public class SILEXRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_silex)};
}
@Override
public String getRecipeID() {
return "silex";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -7,6 +7,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.gui.GUIMachineShredder;
import com.hbm.inventory.recipes.MachineRecipes;
@ -19,8 +21,17 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class ShredderRecipeHandler extends TemplateRecipeHandler {
public class ShredderRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_shredder)};
}
@Override
public String getRecipeID() {
return "ntmRadiolysis";
}
public static ArrayList<Fuel> fuels;
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();

View File

@ -5,6 +5,8 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIAnvil;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
import com.hbm.inventory.recipes.anvil.AnvilSmithingRecipe;
@ -18,8 +20,28 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class SmithingRecipeHandler extends TemplateRecipeHandler {
public class SmithingRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.anvil_iron),
new ItemStack(ModBlocks.anvil_lead),
new ItemStack(ModBlocks.anvil_steel),
new ItemStack(ModBlocks.anvil_desh),
new ItemStack(ModBlocks.anvil_saturnite),
new ItemStack(ModBlocks.anvil_ferrouranium),
new ItemStack(ModBlocks.anvil_bismuth_bronze),
new ItemStack(ModBlocks.anvil_arsenic_bronze),
new ItemStack(ModBlocks.anvil_schrabidate),
new ItemStack(ModBlocks.anvil_dnt),
new ItemStack(ModBlocks.anvil_osmiridium),
new ItemStack(ModBlocks.anvil_murky)};
}
@Override
public String getRecipeID() {
return "ntmSmithing";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();

View File

@ -1,9 +1,17 @@
package com.hbm.handler.nei;
import com.hbm.blocks.generic.BlockToolConversion;
import com.hbm.items.ModItems;
import net.minecraft.item.ItemStack;
public class ToolingHandler extends NEIUniversalHandler {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModItems.boltgun),
new ItemStack(ModItems.blowtorch),
new ItemStack(ModItems.acetylene_torch)};
}
public ToolingHandler() {
super("Tooling", BlockToolConversion.getRecipes(true), BlockToolConversion.getRecipes(false));
}

View File

@ -1,5 +1,10 @@
package com.hbm.main;
import codechicken.nei.recipe.TemplateRecipeHandler;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.VersatileConfig;
import com.hbm.handler.imc.IMCHandlerNHNEI;
import com.hbm.handler.nei.*;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
@ -160,7 +165,12 @@ public class ClientProxy extends ServerProxy {
MinecraftForge.EVENT_BUS.register(handler);
FMLCommonHandler.instance().bus().register(handler);
}
@Override
public void handleNHNEICompat(){
IMCHandlerNHNEI.IMCSender();
}
@Override
public void registerTileEntitySpecialRenderer() {
//test crap
@ -2156,4 +2166,62 @@ public class ClientProxy extends ServerProxy {
if(amplify) color = ColorUtil.amplifyColor(color);
return color;
}
public static ArrayList<TemplateRecipeHandler> handlerList() {
ArrayList<TemplateRecipeHandler> handlers = new ArrayList<>();
handlers.add(new AlloyFurnaceRecipeHandler());
handlers.add(new ShredderRecipeHandler());
handlers.add(new PressRecipeHandler());
handlers.add(new CentrifugeRecipeHandler());
handlers.add(new GasCentrifugeRecipeHandler());
handlers.add(new BreederRecipeHandler());
handlers.add(new CyclotronRecipeHandler());
handlers.add(new AssemblerRecipeHandler());
handlers.add(new RefineryRecipeHandler());
handlers.add(new VacuumRecipeHandler());
handlers.add(new CrackingHandler());
handlers.add(new ReformingHandler());
handlers.add(new HydrotreatingHandler());
handlers.add(new BoilerRecipeHandler());
handlers.add(new ChemplantRecipeHandler());
handlers.add(new CrystallizerRecipeHandler());
handlers.add(new BookRecipeHandler());
handlers.add(new FusionRecipeHandler());
handlers.add(new HadronRecipeHandler());
handlers.add(new SILEXRecipeHandler());
handlers.add(new SmithingRecipeHandler());
handlers.add(new AnvilRecipeHandler());
handlers.add(new FuelPoolHandler());
handlers.add(new FluidRecipeHandler());
handlers.add(new RadiolysisRecipeHandler());
handlers.add(new CrucibleSmeltingHandler());
handlers.add(new CrucibleAlloyingHandler());
handlers.add(new CrucibleCastingHandler());
handlers.add(new ToolingHandler());
handlers.add(new ConstructionHandler());
//universal boyes
handlers.add(new ZirnoxRecipeHandler());
if(VersatileConfig.rtgDecay()) {
handlers.add(new RTGRecipeHandler());
}
handlers.add(new LiquefactionHandler());
handlers.add(new SolidificationHandler());
handlers.add(new CokingHandler());
handlers.add(new FractioningHandler());
handlers.add(new BoilingHandler());
handlers.add(new CombinationHandler());
handlers.add(new SawmillHandler());
handlers.add(new MixerHandler());
handlers.add(new OutgasserHandler());
handlers.add(new ElectrolyserFluidHandler());
handlers.add(new ElectrolyserMetalHandler());
handlers.add(new AshpitHandler());
handlers.add(new ArcWelderHandler());
handlers.add(new ExposureChamberHandler());
for(CustomMachineConfigJSON.MachineConfiguration conf : CustomMachineConfigJSON.niceList) handlers.add(new CustomMachineHandler(conf));
return handlers;
}
}

View File

@ -52,13 +52,10 @@ import com.hbm.world.feature.OreCave;
import com.hbm.world.feature.OreLayer3D;
import com.hbm.world.feature.SchistStratum;
import com.hbm.world.generator.CellularDungeonFactory;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.Metadata;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
@ -820,6 +817,12 @@ public class MainRegistry {
IMCHandler.registerHandler("blastfurnace", new IMCBlastFurnace());
IMCHandler.registerHandler("crystallizer", new IMCCrystallizer());
IMCHandler.registerHandler("centrifuge", new IMCCentrifuge());
if (Loader.isModLoaded("NotEnoughItems")){
if (Loader.instance().getIndexedModList().get("NotEnoughItems").getVersion().contains("GTNH")) {
proxy.handleNHNEICompat();
}
}
}
@EventHandler

View File

@ -1,12 +1,15 @@
package com.hbm.main;
import java.util.ArrayList;
import java.util.List;
import codechicken.nei.recipe.*;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockMotherOfAllOres.TileEntityRandomOre;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.config.VersatileConfig;
import com.hbm.handler.imc.IMCHandlerNHNEI;
import com.hbm.handler.nei.*;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemBattery;
@ -16,75 +19,20 @@ import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import codechicken.nei.api.IHighlightHandler;
import codechicken.nei.api.ItemInfo.Layout;
import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.ICraftingHandler;
import codechicken.nei.recipe.IUsageHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class NEIConfig implements IConfigureNEI {
import static com.hbm.main.ClientProxy.handlerList;
public class NEIConfig implements IConfigureNEI {
@Override
public void loadConfig() {
registerHandler(new AlloyFurnaceRecipeHandler());
registerHandler(new ShredderRecipeHandler());
registerHandler(new PressRecipeHandler());
registerHandler(new CentrifugeRecipeHandler());
registerHandler(new GasCentrifugeRecipeHandler());
registerHandler(new BreederRecipeHandler());
registerHandler(new CyclotronRecipeHandler());
registerHandler(new AssemblerRecipeHandler());
registerHandler(new RefineryRecipeHandler());
registerHandler(new VacuumRecipeHandler());
registerHandler(new CrackingHandler());
registerHandler(new ReformingHandler());
registerHandler(new HydrotreatingHandler());
registerHandler(new BoilerRecipeHandler());
registerHandler(new ChemplantRecipeHandler());
registerHandler(new CrystallizerRecipeHandler());
registerHandler(new BookRecipeHandler());
registerHandler(new FusionRecipeHandler());
registerHandler(new HadronRecipeHandler());
registerHandler(new SILEXRecipeHandler());
registerHandler(new SmithingRecipeHandler());
registerHandler(new AnvilRecipeHandler());
registerHandler(new FuelPoolHandler());
registerHandler(new RadiolysisRecipeHandler());
registerHandler(new CrucibleSmeltingHandler());
registerHandler(new CrucibleAlloyingHandler());
registerHandler(new CrucibleCastingHandler());
registerHandler(new ToolingHandler());
registerHandler(new ConstructionHandler());
//universal boyes
registerHandler(new ZirnoxRecipeHandler());
if(VersatileConfig.rtgDecay()) {
registerHandler(new RTGRecipeHandler());
for (TemplateRecipeHandler handler: handlerList()) {
registerHandler(handler);
}
registerHandler(new LiquefactionHandler());
registerHandler(new SolidificationHandler());
registerHandler(new CokingHandler());
registerHandler(new FractioningHandler());
registerHandler(new BoilingHandler());
registerHandler(new CombinationHandler());
registerHandler(new SawmillHandler());
registerHandler(new MixerHandler());
registerHandler(new OutgasserHandler());
registerHandler(new ElectrolyserFluidHandler());
registerHandler(new ElectrolyserMetalHandler());
registerHandler(new AshpitHandler());
registerHandler(new ArcWelderHandler());
registerHandler(new ExposureChamberHandler());
for(MachineConfiguration conf : CustomMachineConfigJSON.niceList) registerHandlerBypass(new CustomMachineHandler(conf));
//fluids
registerHandler(new FluidRecipeHandler());
//Some things are even beyond my control...or are they?
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
API.hideItem(ItemBattery.getFullBattery(ModItems.memory));

View File

@ -34,6 +34,7 @@ public class ServerProxy {
public void registerItemRenderer() { }
public void registerEntityRenderer() { }
public void registerBlockRenderer() { }
public void handleNHNEICompat() { }
public void particleControl(double x, double y, double z, int type) { }