From 4dfc4f86bf8dfc64df2b8277f9b51528f1dccec7 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sun, 28 Mar 2021 00:12:17 -0700 Subject: [PATCH] Introduce HandlerInfo * Switch handler info loading from code to CSV * Add option to load from config or JAR * handlers.csv is still a WIP --- build.gradle | 16 + build.properties | 2 +- resources/assets/nei/csv/handlers.csv | 250 ++++++++ resources/assets/nei/lang/en_US.lang | 3 + src/codechicken/nei/LayoutManager.java | 4 + src/codechicken/nei/NEIClientConfig.java | 16 +- src/codechicken/nei/NEIModContainer.java | 2 +- src/codechicken/nei/config/HandlerDumper.java | 9 +- src/codechicken/nei/recipe/GuiRecipe.java | 161 ++--- src/codechicken/nei/recipe/GuiRecipeTab.java | 594 ++++-------------- src/codechicken/nei/recipe/HandlerInfo.java | 136 ++++ 11 files changed, 614 insertions(+), 579 deletions(-) create mode 100644 resources/assets/nei/csv/handlers.csv create mode 100644 src/codechicken/nei/recipe/HandlerInfo.java diff --git a/build.gradle b/build.gradle index ff4e9b34..87cfb406 100644 --- a/build.gradle +++ b/build.gradle @@ -67,9 +67,15 @@ configFile.withReader { // setTransitive(false) //} +configurations { + shade + compile.extendsFrom shade +} + dependencies { compile "codechicken:CodeChickenLib:${config.mc_version}-${config.ccl_version}:dev" compile "codechicken:CodeChickenCore:${config.mc_version}-${config.ccc_version}:dev" + shade "org.apache.commons:commons-csv:1.5" } @@ -122,6 +128,11 @@ def commonManifest = { jar { getArchiveClassifier().set("universal") manifest commonManifest + configurations.shade.each { dep -> + from(project.zipTree(dep)){ + exclude 'META-INF', 'META-INF/**' + } + } } task sourceJar(type: Jar) { @@ -140,3 +151,8 @@ task devJar(type: Jar) { artifacts { archives sourceJar, devJar } + +minecraft { + srgExtra "PK: org/apache/commons/csv nei/org/apache/commons/csv" + srgExtra "PK: org/apache/commons/csv/CSVFormat nei/org/apache/commons/csv/CSVFormat" +} \ No newline at end of file diff --git a/build.properties b/build.properties index 48e7f3c8..1fca2b43 100644 --- a/build.properties +++ b/build.properties @@ -2,4 +2,4 @@ mc_version=1.7.10 forge_version=10.13.4.1614-1.7.10 ccl_version=1.1.3.138 ccc_version=1.0.7.+ -mod_version=2.1.0-GTNH-beta5 +mod_version=2.1.0-GTNH-beta6 diff --git a/resources/assets/nei/csv/handlers.csv b/resources/assets/nei/csv/handlers.csv new file mode 100644 index 00000000..f04ce522 --- /dev/null +++ b/resources/assets/nei/csv/handlers.csv @@ -0,0 +1,250 @@ +handler,modName,itemName,nbtInfo,modId,modRequired,excludedModId,yShift,handlerHeight,handlerWidth,maxRecipesPerPage,imageResource,imageX,imageY,imageWidth,imageHeight,itemNotes +codechicken.nei.recipe.BrewingRecipeHandler,minecraft,minecraft:brewing_stand,,minecraft,false,,,65,166,5,,,,,, +codechicken.nei.recipe.FireworkRecipeHandler,minecraft,minecraft:fireworks,,minecraft,false,,,65,166,5,,,,,, +codechicken.nei.recipe.FurnaceRecipeHandler,minecraft,minecraft:furnace,,minecraft,false,,,65,166,5,,,,,, +codechicken.nei.recipe.ShapedRecipeHandler,minecraft,minecraft:crafting_table,,minecraft,false,,,65,166,5,,,,,, +codechicken.nei.recipe.ShapelessRecipeHandler,minecraft,minecraft:crafting_table,,minecraft,false,,,65,166,5,,,,,, +codechicken.nei.recipe.FuelRecipeHandler,minecraft,,,minecraft,false,,,65,166,5,nei:textures/nei_tabbed_sprites.png,80,0,14,14, +advsolar.client.nei.MTRecipeHandler,AdvancedSolarPanel,AdvancedSolarPanel:BlockMolecularTransformer,,AdvancedSolarPanel,true,,,68,,5,,,,,, +appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler,AppliedEnergistics2,appliedenergistics2:item.ItemMultiPart:380,,appliedenergistics2,true,,,,,,,,,,, +appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler,AppliedEnergistics2,appliedenergistics2:item.ItemMultiPart:380,,appliedenergistics2,true,,,,,,,,,,, +appeng.integration.modules.NEIHelpers.NEIFacadeRecipeHandler,AppliedEnergistics2,appliedenergistics2:item.ItemFacade:192,,appliedenergistics2,true,,,65,,5,,,,,, +appeng.integration.modules.NEIHelpers.NEIGrinderRecipeHandler,AppliedEnergistics2,appliedenergistics2:item.ItemMultiMaterial:8,,appliedenergistics2,true,,,,,,,,,,, +appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler,AppliedEnergistics2,appliedenergistics2:tile.BlockInscriber,,appliedenergistics2,true,,,70,,5,,,,,, +appeng.integration.modules.NEIHelpers.NEIWorldCraftingHandler,AppliedEnergistics2,appliedenergistics2:item.ItemMultiMaterial:9,,appliedenergistics2,true,,,85,,5,,,,,,There's only some explanatory text for fluix crystals and QEDs +aroma1997.core.recipes.nei.ShapedAromicRecipeHandler,AromaBackup,minecraft:crafting_table,,AromaBackup,true,,,,,,,,,,, +aroma1997.core.recipes.nei.ShapelessAromicRecipeHandler,AromaBackup,minecraft:crafting_table,,AromaBackup,true,,,,,,,,,,, +fox.spiteful.avaritia.compat.nei.CompressionHandler,Avaritia,Avaritia:Neutronium_Compressor,,Avaritia,true,,,50,,6,,,,,, +fox.spiteful.avaritia.compat.nei.ExtremeShapedRecipeHandler,Avaritia,Avaritia:Dire_Crafting,,Avaritia,true,,,208,256,1,,,,,,Part of it even goes off the left side (included) +fox.spiteful.avaritia.compat.nei.ExtremeShapelessRecipeHandler,Avaritia,Avaritia:Dire_Crafting,,Avaritia,true,,,208,256,1,,,,,,"If you can cut off/place over the jaggedness at the bottom, you could barely get a second one" +WayofTime.alchemicalWizardry.client.nei.NEIAlchemyRecipeHandler,BloodMagic,AWWayofTime:blockWritingTable,,AWWayofTime,true,,,68,,5,,,,,, +WayofTime.alchemicalWizardry.client.nei.NEIAltarRecipeHandler,BloodMagic,AWWayofTime:Altar,,AWWayofTime,true,,,65,,5,,,,,,Handler name needs shifting left +WayofTime.alchemicalWizardry.client.nei.NEIBindingRitualHandler,BloodMagic,AWWayofTime:sacrificialKnife,,AWWayofTime,true,,,50,,6,,,,,, +WayofTime.alchemicalWizardry.client.nei.NEIBloodOrbShapedHandler,BloodMagic,AWWayofTime:AlchemicalWizardrybloodRune:3,,AWWayofTime,true,,,65,,5,,,,,, +WayofTime.alchemicalWizardry.client.nei.NEIBloodOrbShapelessHandler,BloodMagic,AWWayofTime:AlchemicalWizardrybloodRune:4,,AWWayofTime,true,,,65,,5,,,,,, +bw.fuels.acidgens,BartWorks,gregtech:gt.blockmachines:12726,,bartworks,true,,,145,,2,,,,,, +bw.recipe.cal,BartWorks,gregtech:gt.blockmachines:12735,,bartworks,true,,,135,,2,,,,,, +com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioLabHandler,BartWorks,gregtech:gt.blockmachines:12699,,bartworks,true,,,145,,2,,,,,, +com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioVatHandler,BartWorks,gregtech:gt.blockmachines:12712,,bartworks,true,,,140,,2,,,,,, +com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_OreHandler,BartWorks,bartworks:bw.blockores.01:89,,bartworks,true,,,135,,2,,,,,, +gt.recipe.electricimplosioncompressor,BartWorks,gregtech:gt.blockmachines:12734 Electric implosion compressor,,bartworks,true,,,135,,2,,,,,, +net.bdew.neiaddons.botany.flowers.FlowerBreedingHandler,Botany,Botany:flower,,Botany,true,,,65,,5,,,,,, +buildcraft.compat.nei.RecipeHandlerRefinery,BuildCraft,BuildCraft|Factory:refineryBlock,,BuildCraft|Factory,true,,,60,,5,,,,,,There's only 2 recipes though +buildcraft.compat.nei.RecipeHandlerAssemblyTable,BuildCraft,BuildCraft|Silicon:laserTableBlock,,BuildCraft|Silicon,true,,,100,,3,,,,,, +buildcraft.compat.nei.RecipeHandlerIntegrationTable,BuildCraft,BuildCraft|Silicon:laserTableBlock:2,,BuildCraft|Silicon,true,,,85,,4,,,,,, +team.chisel.compat.nei.RecipeHandlerChisel,Chisel,chisel:chisel,,chisel,true,,,135,,2,,,,,, +crazypants.enderio.nei.AlloySmelterRecipeHandler,EnderIO,EnderIO:blockAlloySmelter,,EnderIO,true,,,65,,5,,,,,, +crazypants.enderio.nei.EnchanterRecipeHandler,EnderIO,EnderIO:blockEnchanter,,EnderIO,true,,,65,,5,,,,,, +crazypants.enderio.nei.SagMillRecipeHandler,EnderIO,EnderIO:blockSagMill,,EnderIO,true,,,68,,5,,,,,, +crazypants.enderio.nei.SliceAndSpliceRecipeHandler,EnderIO,EnderIO:blockSliceAndSplice,,EnderIO,true,,,65,,5,,,,,, +crazypants.enderio.nei.SoulBinderRecipeHandler,EnderIO,EnderIO:blockSoulBinder,,EnderIO,true,,,68,,5,,,,,, +crazypants.enderio.nei.VatRecipeHandler,EnderIO,EnderIO:blockVat,,EnderIO,true,,,65,,5,,,,,, +extracells.integration.nei.UniversalTerminalRecipe,ExtraCells,extracells:part.base:9,,extracells,true,,,65,,5,,,,,, +com.rwtema.extrautils.nei.EnderConstructorHandler,ExtraUtilities,ExtraUtilities:endConstructor,,ExtraUtilities,true,,,68,,5,,,,,, +com.rwtema.extrautils.nei.FMPMicroBlocksHandler,ExtraUtilities,ForgeMicroblock:sawIron,,ExtraUtilities,true,,,65,,5,,,,,, +com.rwtema.extrautils.nei.InfoHandler,ExtraUtilities,ExtraUtilities:chandelier,,ExtraUtilities,true,,,135,,2,,,,,,"Info on blocks, can vary wildly. EQ was this length, there might be a longer one" +com.rwtema.extrautils.nei.MicroBlocksHandler,ExtraUtilities,ExtraUtilities:microblocks:1,,ExtraUtilities,true,,,,,,,,,,, +com.rwtema.extrautils.nei.SoulHandler,ExtraUtilities,ExtraUtilities:mini-soul,,ExtraUtilities,true,,,,,,,,,,, +hellfirepvp.beebetteratbees.client.gui.BBABGuiRecipeTreeHandler,Bees,Forestry:beeQueenGE,,Forestry,true,,,140,,2,,,,,, +forestry.factory.recipes.nei.NEIHandlerBottler,Forestry,Forestry:factory,,Forestry,true,,,68,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerCarpenter,Forestry,Forestry:factory:1,,Forestry,true,,,65,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerCentrifuge,Forestry,Forestry:factory:2,,Forestry,true,,,65,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerFabricator,Forestry,Forestry:factory2,,Forestry,true,,,,,,,,,,, +forestry.factory.recipes.nei.NEIHandlerFermenter,Forestry,Forestry:factory:3,,Forestry,true,,,65,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerMoistener,Forestry,Forestry:factory:4,,Forestry,true,,,68,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerSqueezer,Forestry,Forestry:factory:5,,Forestry,true,,,68,,5,,,,,, +forestry.factory.recipes.nei.NEIHandlerStill,Forestry,Forestry:factory:6,,Forestry,true,,,65,,5,,,,,, +net.bdew.neiaddons.forestry.bees.BeeBreedingHandler,Forestry,Forestry:beeQueenGE,,Forestry,true,,,65,,5,,,,,, +net.bdew.neiaddons.forestry.bees.BeeProduceHandler,Forestry,Forestry:beeQueenGE,,Forestry,true,,,65,,5,,,,,, +net.bdew.neiaddons.forestry.butterflies.ButterflyBreedingHandler,Forestry,Forestry:butterflyGE,,Forestry,true,,,,,,,,,,, +net.bdew.neiaddons.forestry.trees.TreeBreedingHandler,Forestry,Forestry:saplingGE,,Forestry,true,,,65,,5,,,,,, +net.bdew.neiaddons.forestry.trees.TreeProduceHandler,Forestry,Forestry:saplingGE,,Forestry,true,,,65,,5,,,,,, +galaxyspace.core.nei.rocket.RocketT1RecipeHandler,Galacticraft,GalacticraftCore:item.spaceship,,GalacticraftCore,true,,,125,,2,,,,,, +micdoodle8.mods.galacticraft.core.nei.BuggyRecipeHandler,Galacticraft,GalacticraftCore:tile.rocketWorkbench,,GalacticraftCore,true,,10,135,,2,,,,,, +micdoodle8.mods.galacticraft.core.nei.CircuitFabricatorRecipeHandler,Galacticraft,GalacticraftCore:tile.machine2:4,,GalacticraftCore,true,,,,,,,,,,, +micdoodle8.mods.galacticraft.core.nei.ElectricIngotCompressorRecipeHandler,Galacticraft,GalacticraftCore:tile.machine2,,GalacticraftCore,true,,,,,,,,,,, +micdoodle8.mods.galacticraft.core.nei.IngotCompressorRecipeHandler,Galacticraft,GalacticraftCore:tile.machine:12,,GalacticraftCore,true,,,,,,,,,,, +micdoodle8.mods.galacticraft.core.nei.RefineryRecipeHandler,Galacticraft,GalacticraftCore:tile.refinery,,GalacticraftCore,true,,,,,,,,,,, +micdoodle8.mods.galacticraft.planets.asteroids.nei.AstroMinerRecipeHandler,Galacticraft,GalacticraftCore:tile.rocketWorkbench,,GalacticraftCore,true,,,100,,3,,,,,, +micdoodle8.mods.galacticraft.planets.mars.nei.CargoRocketRecipeHandler,Galacticraft,GalacticraftCore:tile.rocketWorkbench,,GalacticraftCore,true,,10,125,,2,,,,,, +micdoodle8.mods.galacticraft.planets.mars.nei.GasLiquefierRecipeHandler,Galacticraft,GalacticraftMars:tile.marsMachineT2,,GalacticraftCore,true,,,,,,,,,,, +micdoodle8.mods.galacticraft.planets.mars.nei.MethaneSynthesizerRecipeHandler,Galacticraft,GalacticraftMars:tile.marsMachineT2:4,,GalacticraftCore,true,,,,,,,,,,, +galaxyspace.core.nei.rocket.RocketT2RecipeHandler,Galacticraft,GalacticraftMars:item.spaceshipTier2:1,,GalacticraftMars,true,,5,145,,2,,,,,, +galaxyspace.core.nei.rocket.RocketT3RecipeHandler,Galacticraft,GalacticraftMars:item.itemTier3Rocket,,GalacticraftMars,true,,5,145,,2,,,,,, +galaxyspace.core.nei.AssemblyMachineRecipeHandler,GalaxySpace,GalaxySpace:assemblymachine,,GalaxySpace,true,,,,,,,,,,, +galaxyspace.core.nei.rocket.RocketT4RecipeHandler,GalaxySpace,GalaxySpace:item.Tier4Rocket,,GalaxySpace,true,,10,160,,2,,,,,, +galaxyspace.core.nei.rocket.RocketT5RecipeHandler,GalaxySpace,GalaxySpace:item.Tier5Rocket,,GalaxySpace,true,,10,160,,2,,,,,, +galaxyspace.core.nei.rocket.RocketT6RecipeHandler,GalaxySpace,GalaxySpace:item.Tier6Rocket,,GalaxySpace,true,,10,160,,2,,,,,, +galaxyspace.core.nei.rocket.RocketT7RecipeHandler,GalaxySpace,GalaxySpace:item.Tier7Rocket,,GalaxySpace,true,,10,180,,1,,,,,, +galaxyspace.core.nei.rocket.RocketT8RecipeHandler,GalaxySpace,GalaxySpace:item.Tier8Rocket,,GalaxySpace,true,,10,180,,1,,,,,, +net.bdew.gendustry.nei.ExtractorHandler,Gendustry,gendustry:Extractor,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.ImprinterHandler,Gendustry,gendustry:Imprinter,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.LiquifierHandler,Gendustry,gendustry:Liquifier,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.MutagenProducerHandler,Gendustry,gendustry:MutagenProducer,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.MutatronHandler,Gendustry,gendustry:Mutatron,,gendustry,true,,,65,,5,,,,,, +net.bdew.gendustry.nei.ReplicatorHandler,Gendustry,gendustry:Replicator,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.SamplerHandler,Gendustry,gendustry:Sampler,,gendustry,true,,,68,,5,,,,,, +net.bdew.gendustry.nei.TemplateCraftingHandler,Gendustry,gendustry:GeneTemplate,,gendustry,true,,,105,,3,,,,,,"I don't think there's any actual recipes here, just a generic one" +net.bdew.gendustry.nei.TransposerHandler,Gendustry,gendustry:Transposer,,gendustry,true,,,68,,5,,,,,, +gt.recipe.alloysmelter,gregtech,gregtech:gt.blockmachines:201,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Amplifabricator +gt.recipe.arcfurnace,gregtech,gregtech:gt.blockmachines:651,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Bronze boiler +gt.recipe.assembler,gregtech,gregtech:gt.blockmachines:211,,gregtech,true,gregapi_post,6,145,166,2,,,,,,Byproducts from ore processing +gt.recipe.autoclave,gregtech,gregtech:gt.blockmachines:571,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Disabled 'Thermal Generator'? Or compat for the IC2 geothermal? +gt.recipe.blastfurnace,gregtech,gregtech:gt.blockmachines:1000,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Disabled CNC machine? +gt.recipe.brewer,gregtech,gregtech:gt.blockmachines:491,,gregtech,true,gregapi_post,6,135,166,2,,,,,,ECE +gt.recipe.byproductlist,gregtech,gregtech:gt.metaitem.01:2019,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicgenerator.magicenergyconverter.tier.01 +gt.recipe.canner,gregtech,gregtech:gt.blockmachines:231,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicgenerator.plasmagenerator.tier.05 +gt.recipe.centrifuge,gregtech,gregtech:gt.blockmachines:361,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.arcfurnace.tier.01 +gt.recipe.chemicalbath,gregtech,gregtech:gt.blockmachines:541,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.assembler.tier.01 +gt.recipe.chemicalreactor,gregtech,gregtech:gt.blockmachines:421,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.autoclave.tier.01 +gt.recipe.circuitassembler,gregtech,gregtech:gt.blockmachines:1180,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.bender.tier.01 +gt.recipe.cncmachine,gregtech,gregtech:gt.metaitem.01:23305,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.boxinator.tier.01 +gt.recipe.cokeoven,gregtech,gregtech:gt.blockmachines:791,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.brewery.tier.01 +gt.recipe.componentassembler,gregtech,gregtech:gt.blockmachines:211,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.canner.tier.01 +gt.recipe.compressor,gregtech,gregtech:gt.blockmachines:241,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.centrifuge.tier.01 +gt.recipe.craker,gregtech,gregtech:gt.blockmachines:1160,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.chemicalbath.tier.01 +gt.recipe.cuttingsaw,gregtech,gregtech:gt.blockmachines:251,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.chemicalreactor.tier.01 +gt.recipe.dieselgeneratorfuel,gregtech,gregtech:gt.blockmachines:1110,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.circuitassembler.tier.01 +gt.recipe.distillationtower,gregtech,gregtech:gt.blockmachines:1126,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.compressor.tier.01 +gt.recipe.distillery,gregtech,gregtech:gt.blockmachines:531,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.cutter.tier.01 +gt.recipe.electrolyzer,gregtech,gregtech:gt.blockmachines:371,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.distillery.tier.01 +gt.recipe.electromagneticseparator,gregtech,gregtech:gt.blockmachines:561,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.electrolyzer.tier.01 +gt.recipe.extractor,gregtech,gregtech:gt.blockmachines:271,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.electromagneticseparator.tier.01 +gt.recipe.extrahugenaquadahreactor,gregtech,gregtech:gt.blockmachines:1189,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.extractor.tier.01 +gt.recipe.extremedieselgeneratorfuel,gregtech,gregtech:gt.blockmachines:2105,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.extruder.tier.01 +gt.recipe.extruder,gregtech,gregtech:gt.blockmachines:281,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.fermenter.tier.01 +gt.recipe.fakeAssemblylineProcess,gregtech,gregtech:gt.blockmachines:1170,,gregtech,true,gregapi_post,12,135,166,2,,,,,,gt.blockmachines.basicmachine.fluidcanner.tier.01 +gt.recipe.fermenter,gregtech,gregtech:gt.blockmachines:501,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.fluidextractor.tier.01 +gt.recipe.fluidcanner,gregtech,gregtech:gt.blockmachines:431,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.fluidheater.tier.01 +gt.recipe.fluidextractor,gregtech,gregtech:gt.blockmachines:511,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.fluidsolidifier.tier.01 +gt.recipe.fluidheater,gregtech,gregtech:gt.blockmachines:621,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.hammer.tier.01 +gt.recipe.fluidnaquadahreactor,gregtech,gregtech:gt.blockmachines:1192,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.laserengraver.tier.01 +gt.recipe.fluidsolidifier,gregtech,gregtech:gt.blockmachines:521,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.lathe.tier.01 +gt.recipe.fusionreactor,gregtech,gregtech:gt.blockmachines:1193,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.macerator.tier.01 +gt.recipe.gasturbinefuel,gregtech,gregtech:gt.blockmachines:1115,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.massfab.tier.01 +gt.recipe.hammer,gregtech,gregtech:gt.blockmachines:611,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.microwave.tier.01 +gt.recipe.hugenaquadahreactor,gregtech,gregtech:gt.blockmachines:1188,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.mixer.tier.01 +gt.recipe.implosioncompressor,gregtech,gregtech:gt.blockmachines:12734,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.orewasher.tier.01 +gt.recipe.largeboilerfakefuels,gregtech,gregtech:gt.blockmachines:1020,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.plasmaarcfurnace.tier.01 +gt.recipe.largechemicalreactor,gregtech,gregtech:gt.blockmachines:1169,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.polarizer.tier.01 +gt.recipe.largenaquadahreactor,gregtech,gregtech:gt.blockmachines:1191,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.press.tier.01 +gt.recipe.laserengraver,gregtech,gregtech:gt.blockmachines:591,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.printer.tier.01 +gt.recipe.lathe,gregtech,gregtech:gt.blockmachines:291,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.recycler.tier.01 +gt.recipe.macerator,gregtech,gregtech:gt.blockmachines:301,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.replicator.tier.01 +gt.recipe.magicfuels,gregtech,gregtech:gt.blockmachines:1123,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.rockbreaker.tier.01 +gt.recipe.massfab,gregtech,gregtech:gt.blockmachines:461,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.scanner.tier.01 +gt.recipe.metalbender,gregtech,gregtech:gt.blockmachines:221,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.sifter.tier.01 +gt.recipe.microwave,gregtech,gregtech:gt.blockmachines:311,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.slicer.tier.01 +gt.recipe.mixer,gregtech,gregtech:gt.blockmachines:581,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.thermalcentrifuge.tier.01 +gt.recipe.orewasher,gregtech,gregtech:gt.blockmachines:391,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.unboxinator.tier.01 +gt.recipe.packager,gregtech,gregtech:gt.blockmachines:401,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.basicmachine.wiremill.tier.01 +gt.recipe.plasmaarcfurnace,gregtech,gregtech:gt.blockmachines:661,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.electricimplosioncompressor +gt.recipe.plasmageneratorfuels,gregtech,gregtech:gt.blockmachines:1196,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.fusioncomputer.tier.06 +gt.recipe.polarizer,gregtech,gregtech:gt.blockmachines:551,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.industrialcokeoven.controller.tier.single +gt.recipe.press,gregtech,gregtech:gt.blockmachines:601,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Needs more Yshift? Or doesn't apply properly? Added more +gt.recipe.primitiveblastfurnace,gregtech,gregtech:gt.blockmachines:140,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.blastfurnace +gt.recipe.printer,gregtech,gregtech:gt.blockmachines:321,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.boiler.bronze +gt.recipe.pyro,gregtech,gregtech:gt.blockmachines:1159,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.brickedblastfurnace +gt.recipe.replicator,gregtech,gregtech:gt.blockmachines:481,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.chemicalreactor +gt.recipe.rockbreaker,gregtech,gregtech:gt.blockmachines:441,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.cracker +gt.recipe.scanner,gregtech,gregtech:gt.blockmachines:341,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.distillationtower +gt.recipe.semifluidboilerfuels,gregtech,gregtech:gt.blockmachines:1020,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.pyro +gt.recipe.sifter,gregtech,gregtech:gt.blockmachines:641,,gregtech,true,gregapi_post,6,135,166,2,,,,,,gt.blockmachines.multimachine.vacuumfreezer +gt.recipe.slicer,gregtech,gregtech:gt.blockmachines:631,,gregtech,true,gregapi_post,6,135,166,2,,,,,,GT++'s incomplete compound fabricator? +gt.recipe.smallnaquadahreactor,gregtech,gregtech:gt.blockmachines:1190,,gregtech,true,gregapi_post,6,135,166,2,,,,,,LV Combustion gen +gt.recipe.thermalcentrifuge,gregtech,gregtech:gt.blockmachines:381,,gregtech,true,gregapi_post,6,135,166,2,,,,,,LV gas turbine +gt.recipe.thermalgeneratorfuel,gregtech,IC2:blockGenerator:1,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Naq Reactor Mark I +gt.recipe.unpackager,gregtech,gregtech:gt.blockmachines:411,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Naq Reactor Mark II +gt.recipe.uuamplifier,gregtech,gregtech:gt.blockmachines:471,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Naq Reactor Mark III. Misnamed in code +gt.recipe.vacuumfreezer,gregtech,gregtech:gt.blockmachines:1002,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Naq Reactor Mark IV. Slightly different name for recipe map +gt.recipe.wiremill,gregtech,gregtech:gt.blockmachines:351,,gregtech,true,gregapi_post,6,135,166,2,,,,,,Naq Reactor Mark V. Slightly different name for recipe map +ic.recipe.recycler,gregtech,gregtech:gt.blockmachines:331,,gregtech,true,gregapi_post,6,135,166,2,,,,,, +pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5SmallOreStat,Gregtech,gregtech:gt.blockores:85,,gregtech,true,,,145,,2,,,,,, +pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5VeinStat,Gregtech,gregtech:gt.blockores:386,,gregtech,true,,,135,,2,,,,,, +ic2.neiIntegration.core.recipehandler.AdvRecipeHandler,IC2,IC2:blockreactorvessel,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.AdvShapelessRecipeHandler,IC2,IC2:blockreactorvessel,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.BlastFurnaceRecipeHandler,IC2,IC2:blockMachine3:1,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.BlockCutterRecipeHandler,IC2,IC2:blockMachine3:2,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.CentrifugeRecipeHandler,IC2,IC2:blockMachine2:3,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.CompressorRecipeHandler,IC2,IC2:blockMachine:5,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.ExtractorRecipeHandler,IC2,IC2:blockMachine:4,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.FluidCannerRecipeHandler,IC2,IC2:blockMachine:6,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.LatheRecipeHandler,IC2,IC2:blockMachine3:8,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.MaceratorRecipeHandler,IC2,IC2:blockMachine:3,,IC2,true,,,65,,5,,,,,, +ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerCutting,IC2,IC2:blockMachine2:4,,IC2,true,,,55,,6,,,,,, +ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerExtruding,IC2,IC2:blockMachine2:4,,IC2,true,,,55,,6,,,,,, +ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerRolling,IC2,IC2:blockMachine2:4,,IC2,true,,,55,,6,,,,,, +ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler,IC2,IC2:blockMachine2:5,,IC2,true,,,,,,,,,,, +ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler,IC2,IC2:itemScrapbox,,IC2,true,,,50,,6,,,,,, +ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler,IC2,IC2:blockMachine2:9,,IC2,true,,,,,,,,,,, +speiger.src.crops.prediction.NEIPlugin,IC2CropsNEI,IC2:blockCrop,,Ic2Nei,true,,,135,,2,,,,,,"Not actual recipes, just info" +tonius.neiintegration.mods.mcforge.RecipeHandlerFluidRegistry,Minecraft,minecraft:water,,minecraft,false,,,,,,,,,,, +tonius.neiintegration.mods.mcforge.RecipeHandlerOreDictionary,Minecraft,minecraft:iron_ore,,minecraft,false,,,,,,,,,,, +gt.recipe.alloyblastsmelter,GT++,gregtech:gt.blockmachines:810,,miscutils,true,,,,,,,,,,,ABS +gt.recipe.rocketenginefuel,GT++,gregtech:gt.blockmachines:793,,miscutils,true,,,,,,,,,,,Basic (EV) rocket fuel gen +gt.recipe.cyclotron,GT++,gregtech:gt.blockmachines:828,,miscutils,true,,,,,,,,,,,Cyclotron +gt.recipe.chemicaldehydrator,GT++,gregtech:gt.blockmachines:911,,miscutils,true,,,,,,,,,,,Dehydrator +gt.recipe.slowfusionreactor,GT++,gregtech:gt.blockmachines:31015,,miscutils,true,,,,,,,,,,,gt.blockmachines.gtplusplus.fusion.single +gt.recipe.RTGgenerators,GT++,gregtech:gt.blockmachines:869,,miscutils,true,,,,,,,,,,,GT++ version of the RTG +gt.recipe.cokeoven,GT++,gregtech:gt.blockmachines:791,,miscutils,true,,,,,,,,,,,ICO +gt.recipe.semifluidgeneratorfuels,GT++,gregtech:gt.blockmachines:837,,miscutils,true,,,,,,,,,,,Semifluid gen +gt.recipe.fishpond,GT++,gregtech:gt.blockmachines:829,,miscutils,true,,,,,,,,,,,Zhuhai +gt.recipe.advanced.mixer,GT++,gregtech:gt.blockmachines:811,,miscutils,true,,,,,,,,,,, +gt.recipe.cryogenicfreezer,GT++,gregtech:gt.blockmachines:910,,miscutils,true,,,,,,,,,,, +gt.recipe.fissionfuel,GT++,gregtech:gt.blockmachines:835,,miscutils,true,,,,,,,,,,, +gt.recipe.geothermalfuel,GT++,gregtech:gt.blockmachines:830,,miscutils,true,,,,,,,,,,, +gt.recipe.lftr,GT++,gregtech:gt.blockmachines:751,,miscutils,true,,,,,,,,,,, +gt.recipe.lftr.2,GT++,gregtech:gt.blockmachines:751,,miscutils,true,,,,,,,,,,, +gt.recipe.matterfab2,GT++,gregtech:gt.blockmachines:799,,miscutils,true,,,,,,,,,,, +gt.recipe.multicentrifuge,GT++,gregtech:gt.blockmachines:790,,miscutils,true,,,,,,,,,,, +gt.recipe.multielectro,GT++,gregtech:gt.blockmachines:796,,miscutils,true,,,,,,,,,,, +gt.recipe.simplewasher,GT++,gregtech:gt.blockmachines:767,,miscutils,true,,,,,,,,,,, +gt.recipe.vacfurnace,GT++,gregtech:gt.blockmachines:995,,miscutils,true,,,,,,,,,,, +gtPlusPlus.nei.DecayableRecipeHandler,GT++,miscutils:dustRadium226,,miscutils,true,,,75,,4,,,,,, +gtPlusPlus.nei.GT_NEI_FlotationCell,GT++,gregtech:gt.blockmachines:31028,,miscutils,true,,,120,,2,,,,,, +gtPlusPlus.nei.GT_NEI_FluidReactor,GT++,gregtech:gt.blockmachines:998,,miscutils,true,,,,,,,,,,, +gtPlusPlus.nei.GT_NEI_MillingMachine,GT++,gregtech:gt.blockmachines:31027,,miscutils,true,,,120,,2,,,,,, +li.cil.oc.integration.nei.CallbackDocHandler,OpenComputers,OpenComputers:item:98,,OpenComputers,true,,,,,,,,,,, +li.cil.oc.integration.nei.ManualUsageHandler,OpenComputers,OpenComputers:item:98,,OpenComputers,true,,,,,,,,,,, +tonius.neiintegration.mods.harvestcraft.RecipeHandlerApiary,Pam's Harvestcraft,harvestcraft:apiary,,harvestcraft,true,,,70,,5,,,,,,There's only 1 though +tonius.neiintegration.mods.harvestcraft.RecipeHandlerChurn,Pam's Harvestcraft,harvestcraft:churn,,harvestcraft,true,,,65,,5,,,,,,Same as above +tonius.neiintegration.mods.harvestcraft.RecipeHandlerOven,Pam's Harvestcraft,harvestcraft:oven,,harvestcraft,true,,,65,,5,,,,,, +tonius.neiintegration.mods.harvestcraft.RecipeHandlerPresser,Pam's Harvestcraft,harvestcraft:presser,,harvestcraft,true,,,65,,5,,,,,, +tonius.neiintegration.mods.harvestcraft.RecipeHandlerQuern,Pam's Harvestcraft,harvestcraft:quern,,harvestcraft,true,,,65,,5,,,,,, +gcewing.projectblue.nei.NEIRecipeHandler,ProjectBlue,ProjectBlue:sprayCan,,ProjectBlue,true,,,65,,5,,,,,, +mrtjp.projectred.core.libmc.recipe.PRShapedRecipeHandler,ProjectRed,ProjRed|Transmission:projectred.transmission.wire:7,,ProjRed|Transmission,true,,,,,,,,,,, +mrtjp.projectred.core.libmc.recipe.PRShapelessRecipeHandler,ProjectRed,ProjRed|Transmission:projectred.transmission.wire:7,,ProjRed|Transmission,true,,,,,,,,,,, +tonius.neiintegration.mods.railcraft.RecipeHandlerBlastFurnace,Railcraft,Railcraft:machine.alpha:12,,Railcraft,true,,,,,,,,,,, +tonius.neiintegration.mods.railcraft.RecipeHandlerCokeOven,Railcraft,Railcraft:machine.alpha:7,,Railcraft,true,,,65,,5,,,,,, +tonius.neiintegration.mods.railcraft.RecipeHandlerRockCrusher,Railcraft,Railcraft:machine.alpha:15,,Railcraft,true,,,,,,,,,,, +tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShaped,Railcraft,Railcraft:machine.alpha:8,,Railcraft,true,,,65,,5,,,,,, +tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShapeless,Railcraft,Railcraft:machine.alpha:8,,Railcraft,true,,,,,,,,,,, +lumien.randomthings.Handler.ModCompability.NEI.ImbuingStationRecipeHandler,RandomThings,RandomThings:imbuingStation,,RandomThings,true,,,120,,2,,,,,, +com.github.technus.tectech.nei.TT_NEI_ResearchHandler,TecTech,gregtech:gt.blockmachines:15331,,tectech,true,,6,140,,2,,,,,, +com.github.technus.tectech.nei.TT_NEI_ScannerHandler,TecTech,tectech:item.em.definitionScanStorage,,tectech,true,,,,,,,,,,, +com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapedRecipeHandler,Thaumcraft,Thaumcraft:blockTable:15,,Thaumcraft,true,,,,,,,,,,, +com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapelessRecipeHandler,Thaumcraft,Thaumcraft:blockTable:15,,Thaumcraft,true,,,140,,2,,,,,, +com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.CrucibleRecipeHandler,Thaumcraft,Thaumcraft:blockMetalDevice,,Thaumcraft,true,,,140,,2,,,,,,Using R on an item you get from the crucible basically never works +com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.InfusionRecipeHandler,Thaumcraft,Thaumcraft:blockStoneDevice:2,,Thaumcraft,true,,,140,,2,,,,,, +ru.timeconqueror.tcneiadditions.nei.arcaneworkbench.ArcaneCraftingShapedHandler,Thaumcraft,Thaumcraft:blockTable:15,,Thaumcraft,true,,,140,,2,,,,,, +ru.timeconqueror.tcneiadditions.nei.AspectCombinationHandler,Thaumcraft,Thaumcraft:ItemResearchNotes,,Thaumcraft,true,,,130,,2,,,,,,In sets of 5. Each one is ~30 height +ru.timeconqueror.tcneiadditions.nei.AspectFromItemStackHandler,Thaumcraft,Thaumcraft:ItemResearchNotes,,Thaumcraft,true,,,140,,2,,,,,, +tconstruct.plugins.nei.RecipeHandlerAlloying,Tinker's Construct,TConstruct:Smeltery,,TConstruct,true,,,65,,5,,,,,, +tconstruct.plugins.nei.RecipeHandlerCastingBasin,Tinker's Construct,TConstruct:SearedBlock:2,,TConstruct,true,,,65,,5,,,,,, +tconstruct.plugins.nei.RecipeHandlerCastingTable,Tinker's Construct,TConstruct:SearedBlock,,TConstruct,true,,,65,,5,,,,,, +tconstruct.plugins.nei.RecipeHandlerDryingRack,Tinker's Construct,TConstruct:Armor.DryingRack,,TConstruct,true,,,55,,5,,,,,, +tconstruct.plugins.nei.RecipeHandlerMelting,Tinker's Construct,TConstruct:LavaTank:2,,TConstruct,true,,,65,,5,,,,,, +tconstruct.plugins.nei.RecipeHandlerToolMaterials,Tinker's Construct,TConstruct:ToolStationBlock,,TConstruct,true,,,110,,3,,,,,,"Longer if more modifiers, I went through the whole list" +net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler,WirelessCraftingTerminal,ae2wct:wirelessCraftingTerminal,,ae2wct,true,,,,,,,,,,, +alkalus.main.nei.NEI_Handler_Cauldron,witchery,witchery:cauldron,,WitcheryExtras,true,,,65,,5,,,,,, +alkalus.main.nei.NEI_Handler_Distillery,witchery,witchery:distilleryidle,,WitcheryExtras,true,,,140,,2,,,,,, +alkalus.main.nei.NEI_Handler_Kettle,witchery,witchery:kettle,,WitcheryExtras,true,,,65,,5,,,,,, +alkalus.main.nei.NEI_Handler_Oven,witchery,witchery:witchesovenidle,,WitcheryExtras,true,,,,,,,,,,,Not working at all now +alkalus.main.nei.NEI_Handler_SpinningWheel,witchery,witchery:spinningwheel,,WitcheryExtras,true,,,65,,5,,,,,, +com.emoniph.witchery.integration.NEICauldronRecipeHandler,witchery,witchery:cauldron,,witchery,true,,,,,,,,,,,Replaced by WE presumably +com.emoniph.witchery.integration.NEIDistilleryRecipeHandler,witchery,witchery:distilleryidle,,witchery,true,,,,,,,,,,,Replaced by WE presumably +com.emoniph.witchery.integration.NEIKettleRecipeHandler,witchery,witchery:kettle,,witchery,true,,,,,,,,,,,Replaced by WE presumably +com.emoniph.witchery.integration.NEISpinningWheelRecipeHandler,witchery,witchery:spinningwheel,,witchery,true,,,,,,,,,,,Replaced by WE presumably +com.emoniph.witchery.integration.NEIWitchesOvenRecipeHandler,witchery,witchery:witchesovenidle,,witchery,true,,,,,,,,,,,Replaced by WE presumably +witchinggadgets.client.nei.NEIInfernalBlastfurnaceHandler,WitchingGadgets,WitchingGadgets:WG_StoneDevice:2,,WitchingGadgets,true,,,65,,5,,,,,, +witchinggadgets.client.nei.NEISpinningWheelHandler,WitchingGadgets,WitchingGadgets:WG_WoodenDevice,,WitchingGadgets,true,,,110,,3,,,,,, \ No newline at end of file diff --git a/resources/assets/nei/lang/en_US.lang b/resources/assets/nei/lang/en_US.lang index 0f567c62..fd9b220d 100644 --- a/resources/assets/nei/lang/en_US.lang +++ b/resources/assets/nei/lang/en_US.lang @@ -169,6 +169,9 @@ nei.options.world.highlight_tips.show=Shown nei.options.world.highlight_tips.sample=Sample nei.options.tools=Tools +nei.options.tools.handler_load_from_config=Load handlers from Config +nei.options.tools.handler_load_from_config.true=Config +nei.options.tools.handler_load_from_config.false=JAR nei.options.tools.dump=Data Dumps nei.options.tools.dump.dump=Dump nei.options.tools.dump.dumped=%s IDs dumped to %s diff --git a/src/codechicken/nei/LayoutManager.java b/src/codechicken/nei/LayoutManager.java index 39b27e00..785326bf 100644 --- a/src/codechicken/nei/LayoutManager.java +++ b/src/codechicken/nei/LayoutManager.java @@ -15,6 +15,7 @@ import codechicken.nei.guihook.IContainerDrawHandler; import codechicken.nei.guihook.IContainerInputHandler; import codechicken.nei.guihook.IContainerObjectHandler; import codechicken.nei.guihook.IContainerTooltipHandler; +import codechicken.nei.recipe.GuiRecipeTab; import cpw.mods.fml.common.Loader; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -347,6 +348,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LCONTROL || Keyboard.getEventKey() == Keyboard.KEY_RCONTROL)) { NEIClientConfig.cycleSetting("inventory.cheatmode", 3); } else { + if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT || Keyboard.getEventKey() == Keyboard.KEY_RSHIFT)) { + GuiRecipeTab.loadHandlerInfo(); + } getOptionList().openGui(getGuiContainer(), false); } return true; diff --git a/src/codechicken/nei/NEIClientConfig.java b/src/codechicken/nei/NEIClientConfig.java index b174fc79..eb87d013 100644 --- a/src/codechicken/nei/NEIClientConfig.java +++ b/src/codechicken/nei/NEIClientConfig.java @@ -24,6 +24,7 @@ import codechicken.nei.config.OptionTextField; import codechicken.nei.config.OptionToggleButton; import codechicken.nei.config.OptionToggleButtonBoubs; import codechicken.nei.config.OptionUtilities; +import codechicken.nei.recipe.GuiRecipeTab; import codechicken.nei.recipe.RecipeInfo; import codechicken.obfuscator.ObfuscationRun; import net.minecraft.client.Minecraft; @@ -52,6 +53,7 @@ public class NEIClientConfig new ConfigFile(new File(configDir, "client.cfg"))); public static ConfigSet world; public static final File bookmarkFile = new File(configDir, "bookmarks.ini"); + public static final File handlerFile = new File(configDir, "handlers.csv"); public static ItemStack[] creativeInv; @@ -132,7 +134,16 @@ public class NEIClientConfig tag.getTag("inventory.creative_tab_style").setComment("Creative or JEI style tabs").getBooleanValue(false); API.addOption(new OptionToggleButton("inventory.creative_tab_style", true)); - + + tag.getTag("tools.handler_load_from_config").setComment("ADVANCED: Load handlers from config").getBooleanValue(false); + API.addOption(new OptionToggleButton("tools.handler_load_from_config", true) { + @Override + public boolean onClick(int button) { + super.onClick(button); + GuiRecipeTab.loadHandlerInfo(); + return true; + } + }); setDefaultKeyBindings(); } @@ -303,6 +314,9 @@ public class NEIClientConfig public static boolean isEnabled() { return enabledOverride && getBooleanSetting("inventory.widgetsenabled"); } + public static boolean loadHandlersFromJar() { + return !getBooleanSetting("tools.handler_load_from_config"); + } public static void setEnabled(boolean flag) { getSetting("inventory.widgetsenabled").setBooleanValue(flag); diff --git a/src/codechicken/nei/NEIModContainer.java b/src/codechicken/nei/NEIModContainer.java index 044d245d..be15748e 100644 --- a/src/codechicken/nei/NEIModContainer.java +++ b/src/codechicken/nei/NEIModContainer.java @@ -96,7 +96,7 @@ public class NEIModContainer extends DummyModContainer @Subscribe public void postInit(FMLPostInitializationEvent event) { if (CommonUtils.isClient()) - GuiRecipeTab.initStackMap(); + GuiRecipeTab.loadHandlerInfo(); } @Override public VersionRange acceptableMinecraftVersionRange() { diff --git a/src/codechicken/nei/config/HandlerDumper.java b/src/codechicken/nei/config/HandlerDumper.java index 455b1948..b866c060 100644 --- a/src/codechicken/nei/config/HandlerDumper.java +++ b/src/codechicken/nei/config/HandlerDumper.java @@ -3,6 +3,7 @@ package codechicken.nei.config; import codechicken.nei.NEIClientConfig; import codechicken.nei.recipe.GuiRecipeTab; import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.HandlerInfo; import codechicken.nei.recipe.IRecipeHandler; import codechicken.nei.recipe.TemplateRecipeHandler; import codechicken.nei.util.NBTJson; @@ -37,14 +38,14 @@ public class HandlerDumper extends DataDumper for (IRecipeHandler handler : GuiUsageRecipe.usagehandlers) { final String handlerName = handler.toString().split("@")[0]; final String handlerId = Objects.firstNonNull(handler instanceof TemplateRecipeHandler ? ((TemplateRecipeHandler)handler).getOverlayIdentifier() : null, "null"); - Pair stackMapEntry = GuiRecipeTab.lookupStackMap(handlerName, handlerId); - + HandlerInfo info = GuiRecipeTab.getHandlerInfo(handlerName, handlerId); + list.add(new String[] { handler.getRecipeName(), handlerName, handlerId, - stackMapEntry != null ? stackMapEntry.getLeft() : "Unknown", - stackMapEntry != null ? stackMapEntry.getRight().toString() : "Unknown" + info != null ? info.getModName() : "Unknown", + info != null ? info.getItemStack().toString() : "Unknown" }); } return list; diff --git a/src/codechicken/nei/recipe/GuiRecipe.java b/src/codechicken/nei/recipe/GuiRecipe.java index dcebdd7d..14dc2a93 100644 --- a/src/codechicken/nei/recipe/GuiRecipe.java +++ b/src/codechicken/nei/recipe/GuiRecipe.java @@ -1,17 +1,13 @@ package codechicken.nei.recipe; import codechicken.lib.gui.GuiDraw; -import codechicken.lib.render.CCRenderState; import codechicken.nei.GuiNEIButton; -import codechicken.nei.LayoutManager; import codechicken.nei.NEIClientConfig; import codechicken.nei.NEIClientUtils; import codechicken.nei.PositionedStack; import codechicken.nei.VisiblityData; import codechicken.nei.api.IGuiContainerOverlay; import codechicken.nei.api.INEIGuiHandler; -import codechicken.nei.api.IOverlayHandler; -import codechicken.nei.api.IRecipeOverlayRenderer; import codechicken.nei.api.TaggedInventoryArea; import codechicken.nei.drawable.DrawableBuilder; import codechicken.nei.drawable.DrawableResource; @@ -67,11 +63,6 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve } } - // DEPRECATED -// public GuiButton overlay1; -// public GuiButton overlay2; - // END DEPRECATED - public int page; public int recipetype; public ContainerRecipe slotcontainer; @@ -81,8 +72,11 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve public GuiButton prevpage; private GuiButton nexttype; private GuiButton prevtype; + private final Rectangle area = new Rectangle(); private final GuiRecipeTabs recipeTabs; + private IRecipeHandler handler; + private HandlerInfo handlerInfo; private int yShift = 0; @@ -118,29 +112,26 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve nextpage = new GuiNEIButton(2, leftButtonX, guiTop + 17, buttonWidth, buttonHeight, "<"); prevpage = new GuiNEIButton(3, rightButtonX, guiTop + 17, buttonWidth, buttonHeight, ">"); -// overlay1 = new GuiNEIButton(4, width / 2 + 65, guiTop + 63, buttonWidth, buttonHeight, "?"); -// overlay2 = new GuiNEIButton(5, width / 2 + 65, guiTop + 128, buttonWidth, buttonHeight, "?"); - buttonList.addAll(Arrays.asList(nexttype, prevtype, nextpage, prevpage)); if (currenthandlers.size() == 1) { nexttype.visible = false; prevtype.visible = false; } - checkGregTech(); + if(handler == null) setRecipePage(recipetype); + + checkYShift(); recipeTabs.initLayout(); refreshPage(); } - private void checkGregTech() { - IRecipeHandler handler = currenthandlers.get(recipetype); - if (gregtechHandler != null && gregtechHandler.isInstance(handler)) { - // Gregtech decided to shift their handler by -8 and draw over shit... - yShift = 6; + private void checkYShift() { + if (handlerInfo != null) { + yShift = handlerInfo.getYShift(); } else { yShift = 0; } } - + @Override public void keyTyped(char c, int i) { if (i == Keyboard.KEY_ESCAPE) //esc @@ -151,10 +142,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve if (GuiContainerManager.getManager(this).lastKeyTyped(i, c)) return; - IRecipeHandler recipehandler = currenthandlers.get(recipetype); final int recipesPerPage = getRecipesPerPage(); - for (int recipe = page * recipesPerPage; recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++) - if (recipehandler.keyTyped(this, c, i, recipe)) + for (int recipe = page * recipesPerPage; recipe < handler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++) + if (handler.keyTyped(this, c, i, recipe)) return; if (i == mc.gameSettings.keyBindInventory.getKeyCode()) @@ -174,10 +164,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve @Override protected void mouseClicked(int x, int y, int button) { - IRecipeHandler recipehandler = currenthandlers.get(recipetype); final int recipesPerPage = getRecipesPerPage(); - for (int recipe = page * recipesPerPage; recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++) - if (recipehandler.mouseClicked(this, button, recipe)) + for (int recipe = page * recipesPerPage; recipe < handler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++) + if (handler.mouseClicked(this, button, recipe)) return; if (recipeTabs.mouseClicked(x, y, button)) return; @@ -201,28 +190,21 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve case 3: nextPage(); break; -// case 4: -// overlayRecipe(page * recipesPerPage); -// break; -// case 5: -// overlayRecipe(page * recipesPerPage + 1); -// break; } } @Override public void updateScreen() { super.updateScreen(); - currenthandlers.get(recipetype).onUpdate(); + handler.onUpdate(); refreshPage(); } @Override public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) { final int recipesPerPage = getRecipesPerPage(); - IRecipeHandler recipehandler = currenthandlers.get(recipetype); - for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) - currenttip = recipehandler.handleTooltip(this, currenttip, i); + for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) + currenttip = handler.handleTooltip(this, currenttip, i); recipeTabs.handleTooltip(mousex, mousey, currenttip); return currenttip; } @@ -230,9 +212,8 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve @Override public List handleItemTooltip(GuiContainer gui, ItemStack stack, int mousex, int mousey, List currenttip) { final int recipesPerPage = getRecipesPerPage(); - IRecipeHandler recipehandler = currenthandlers.get(recipetype); - for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) - currenttip = recipehandler.handleItemTooltip(this, stack, currenttip, i); + for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) + currenttip = handler.handleItemTooltip(this, stack, currenttip, i); return currenttip; } @@ -244,12 +225,12 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve private void nextPage() { page++; - if (page > (currenthandlers.get(recipetype).numRecipes() - 1) / getRecipesPerPage()) page = 0; + if (page > (handler.numRecipes() - 1) / getRecipesPerPage()) page = 0; } private void prevPage() { page--; - if (page < 0) page = (currenthandlers.get(recipetype).numRecipes() - 1) / getRecipesPerPage(); + if (page < 0) page = (handler.numRecipes() - 1) / getRecipesPerPage(); } private void nextType() { @@ -264,76 +245,56 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve recipetype = idx; if (recipetype < 0) recipetype = currenthandlers.size() - 1; else if (recipetype >= currenthandlers.size()) recipetype = 0; + handler = currenthandlers.get(recipetype); + handlerInfo = getHandlerInfo(handler); page = 0; recipeTabs.calcPageNumber(); - checkGregTech(); + checkYShift(); } -// private void overlayRecipe(int recipe) { -// IRecipeOverlayRenderer renderer = currenthandlers.get(recipetype).getOverlayRenderer(firstGui, recipe); -// IOverlayHandler handler = currenthandlers.get(recipetype).getOverlayHandler(firstGui, recipe); -// boolean shift = NEIClientUtils.shiftKey(); -// -// if (handler != null && (renderer == null || shift)) { -// mc.displayGuiScreen(firstGui); -// handler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift); -// } else if (renderer != null) { -// mc.displayGuiScreen(firstGui); -// LayoutManager.overlayRenderer = renderer; -// } -// } + public HandlerInfo getHandlerInfo(IRecipeHandler handler) { + final String handlerName = handler.toString().split("@")[0]; + final String handlerID; + if(handler instanceof TemplateRecipeHandler) { + handlerID = (((TemplateRecipeHandler)handler).getOverlayIdentifier()); + } else { + handlerID = null; + } + return GuiRecipeTab.getHandlerInfo(handlerName, handlerID); + } + + public void refreshPage() { refreshSlots(); - IRecipeHandler handler = currenthandlers.get(recipetype); - area.width = xSize; - area.height = ySize; + area.width = handlerInfo.getWidth(); + area.height = handlerInfo.getHeight(); area.x = guiLeft - 2; area.y = guiTop - 4; - - calcArea(handler); - checkGregTech(); + checkYShift(); final int recipesPerPage = getRecipesPerPage(); boolean multiplepages = handler.numRecipes() > recipesPerPage; nextpage.enabled = prevpage.enabled = multiplepages; - -// // TODO: Display overlay buttons here again -// if(firstGui != null) { -// overlay1.yPosition = guiTop + 17 + (recipesPerPage == 2 ? 63 : 128); -// overlay1.visible = handler.hasOverlay(firstGui, firstGui.inventorySlots, page * recipesPerPage); -// overlay2.visible = recipesPerPage == 2 && page * recipesPerPage + 1 < handler.numRecipes() && handler.hasOverlay(firstGui, firstGui.inventorySlots, page * recipesPerPage + 1); -// } else { -// overlay1.visible = overlay2.visible = false; -// } recipeTabs.refreshPage(); } - private void calcArea(IRecipeHandler handler) { - if ( handler.getClass().toString().contains("fox.spiteful.avaritia.compat.nei.")) { - // Handle Avarita's oversized handler area - area.width = 256; - area.height = 208; - } - } - private void refreshSlots() { slotcontainer.inventorySlots.clear(); final int recipesPerPage = getRecipesPerPage(); - IRecipeHandler recipehandler = currenthandlers.get(recipetype); - for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { + for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { Point p = getRecipePosition(i); - List stacks = recipehandler.getIngredientStacks(i); + List stacks = handler.getIngredientStacks(i); for (PositionedStack stack : stacks) slotcontainer.addSlot(stack, p.x, p.y); - stacks = recipehandler.getOtherStacks(i); + stacks = handler.getOtherStacks(i); for (PositionedStack stack : stacks) slotcontainer.addSlot(stack, p.x, p.y); - PositionedStack result = recipehandler.getResultStack(i); + PositionedStack result = handler.getResultStack(i); if (result != null) slotcontainer.addSlot(result, p.x, p.y); } @@ -343,17 +304,16 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { GuiContainerManager.enable2DRender(); final int recipesPerPage = getRecipesPerPage(); - IRecipeHandler recipehandler = currenthandlers.get(recipetype); - String s = recipehandler.getRecipeName(); + String s = handler.getRecipeName(); fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0xffffff); - s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipesPerPage + 1); + s = NEIClientUtils.translate("recipe.page", page + 1, (handler.numRecipes() - 1) / recipesPerPage + 1); fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 19, 0xffffff); GL11.glPushMatrix(); GL11.glTranslatef(5, 32 + yShift, 0); - for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { - recipehandler.drawForeground(i); - GL11.glTranslatef(0, 65, 0); + for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { + handler.drawForeground(i); + GL11.glTranslatef(0, handlerInfo.getHeight(), 0); } GL11.glPopMatrix(); } @@ -387,10 +347,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve GL11.glPushMatrix(); GL11.glTranslatef(j + 5, k + 32 + yShift, 0); - IRecipeHandler recipehandler = currenthandlers.get(recipetype); - for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { - recipehandler.drawBackground(i); - GL11.glTranslatef(0, 65, 0); + for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) { + handler.drawBackground(i); + GL11.glTranslatef(0, handlerInfo.getHeight(), 0); } GL11.glPopMatrix(); } @@ -434,22 +393,14 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve } private int getRecipesPerPage() { - // The handlers give no indication of height, and use hard coded values - // The default handlers have a height of 65. Go with the (most likely incorrect) assumption - // that if a handler allows more than one recipe per page the height is 65 so use that to calculate the # per page. - // If it only allows for 1 then it's unknown and we'll stick with 1 recipe per page. - - final IRecipeHandler handler = currenthandlers.get(recipetype); - final int handlerRecipesPerPage = handler.recipiesPerPage(); - if (handler instanceof TemplateRecipeHandler && handlerRecipesPerPage > 1) { - return ((ySize - (prevtype.height*3)) / 65); - } else { - return handlerRecipesPerPage; - } + if(handlerInfo != null) + return Math.max(Math.min(((ySize - (prevtype.height*3)) / handlerInfo.getHeight()), handlerInfo.getMaxRecipesPerPage()), 1); + else + return (handler.recipiesPerPage()); } public Point getRecipePosition(int recipe) { - return new Point(5, 32 + yShift + (recipe % getRecipesPerPage()) * 65); + return new Point(5, 32 + yShift + ((recipe % getRecipesPerPage()) * handlerInfo.getHeight())); } @Override diff --git a/src/codechicken/nei/recipe/GuiRecipeTab.java b/src/codechicken/nei/recipe/GuiRecipeTab.java index 76a805f4..689fdab7 100644 --- a/src/codechicken/nei/recipe/GuiRecipeTab.java +++ b/src/codechicken/nei/recipe/GuiRecipeTab.java @@ -4,24 +4,34 @@ package codechicken.nei.recipe; import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIClientConfig; import codechicken.nei.Widget; -import codechicken.nei.drawable.DrawableBuilder; import codechicken.nei.drawable.DrawableResource; import codechicken.nei.guihook.GuiContainerManager; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.client.gui.FontRenderer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.csv.CSVFormat; +import org.apache.commons.csv.CSVParser; +import org.apache.commons.csv.CSVRecord; +import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.ReadableByteChannel; import java.util.HashMap; import java.util.List; public abstract class GuiRecipeTab extends Widget { - public static HashMap> imageMap = new HashMap<>(); - public static HashMap> stackMap = new HashMap<>(); + public static HashMap handlerMap = new HashMap<>(); private final GuiRecipe guiRecipe; private final IRecipeHandler handler; @@ -81,9 +91,9 @@ public abstract class GuiRecipeTab extends Widget { final int iconY = getForegroundIconY(); final FontRenderer fontRenderer = GuiDraw.fontRenderer; - final DrawableResource icon = getImage(handlerName); - - final ItemStack itemStack = getItemStack(handlerName, handlerID); + final HandlerInfo handlerInfo = getHandlerInfo(handlerName, handlerID); + final DrawableResource icon = handlerInfo != null ? handlerInfo.getImage() : null; + final ItemStack itemStack = handlerInfo != null ? handlerInfo.getItemStack() : null; if (icon != null) { @@ -108,8 +118,9 @@ public abstract class GuiRecipeTab extends Widget { String handlerMod = getHandlerMod(handlerName, handlerID); tooltip.add(EnumChatFormatting.BLUE + handlerMod); - - if (handlerMod.equals("Unknown")) { + + boolean shiftHeld = Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT || Keyboard.getEventKey() == Keyboard.KEY_RSHIFT); + if (handlerMod.equals("Unknown") || shiftHeld) { tooltip.add(""); tooltip.add("HandlerName: " + handlerName); tooltip.add("HandlerID: " + handlerID); @@ -130,474 +141,123 @@ public abstract class GuiRecipeTab extends Widget { selected = handler == current; } - public static Pair lookupStackMap(String name, String name2) { - Pair res = stackMap.get(name); - if (res == null) res = stackMap.get(name2); - + public static HandlerInfo getHandlerInfo(String name, String name2) { + HandlerInfo res = handlerMap.get(name); + if (res == null) res = handlerMap.get(name2); + return res; } public static String getHandlerMod(String name, String name2) { - Pair stackRes = lookupStackMap(name, name2); - if (stackRes != null) - return stackRes.getLeft(); - - Pair iconRes = imageMap.get(name); - if (iconRes != null) - return iconRes.getLeft(); + HandlerInfo info = getHandlerInfo(name, name2); + if (info == null) + return "Unknown"; - return "Unknown"; + return info.getModName(); } - private ItemStack getItemStack(String handlerName, String handlerID) { - Pair lookup = lookupStackMap(handlerName, handlerID); - if (lookup != null) - return lookup.getRight(); - return null; - } - - public static DrawableResource getImage(String id) { - Pair res = imageMap.get(id); - if (res != null) - return res.getRight(); - return null; - } - - public static void initStackMap() { - System.out.println("InitStackMap() --------"); - // Vanilla - addToStackMap("codechicken.nei.recipe.BrewingRecipeHandler", "minecraft", "minecraft:brewing_stand"); - addToStackMap("codechicken.nei.recipe.FireworkRecipeHandler", "minecraft", "minecraft:fireworks"); - addToStackMap("codechicken.nei.recipe.FurnaceRecipeHandler", "minecraft", "minecraft:furnace"); - addToStackMap("codechicken.nei.recipe.ShapedRecipeHandler", "minecraft", "minecraft:crafting_table"); - addToStackMap("codechicken.nei.recipe.ShapelessRecipeHandler", "minecraft", "minecraft:crafting_table"); - addToIconMap("codechicken.nei.recipe.FuelRecipeHandler", "minecraft", - new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 80, 0, 14, 14).build()); - - // IC2 - if (Loader.isModLoaded("IC2")) { - addToStackMap("ic2.neiIntegration.core.recipehandler.AdvRecipeHandler", "IC2", "IC2:blockreactorvessel"); - addToStackMap("ic2.neiIntegration.core.recipehandler.AdvShapelessRecipeHandler", "IC2", "IC2:blockreactorvessel"); - addToStackMap("ic2.neiIntegration.core.recipehandler.BlastFurnaceRecipeHandler", "IC2", "IC2:blockMachine3:1"); - addToStackMap("ic2.neiIntegration.core.recipehandler.BlockCutterRecipeHandler", "IC2", "IC2:blockMachine3:2"); - addToStackMap("ic2.neiIntegration.core.recipehandler.CentrifugeRecipeHandler", "IC2", "IC2:blockMachine2:3"); - addToStackMap("ic2.neiIntegration.core.recipehandler.CompressorRecipeHandler", "IC2", "IC2:blockMachine:5"); - addToStackMap("ic2.neiIntegration.core.recipehandler.ExtractorRecipeHandler", "IC2", "IC2:blockMachine:4"); - addToStackMap("ic2.neiIntegration.core.recipehandler.FluidCannerRecipeHandler", "IC2", "IC2:blockMachine:6"); - addToStackMap("ic2.neiIntegration.core.recipehandler.LatheRecipeHandler", "IC2", "IC2:blockMachine3:8"); - addToStackMap("ic2.neiIntegration.core.recipehandler.MaceratorRecipeHandler", "IC2", "IC2:blockMachine:3"); - addToStackMap("ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerCutting", "IC2", "IC2:blockMachine2:4"); - addToStackMap("ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerExtruding", "IC2", "IC2:blockMachine2:4"); - addToStackMap("ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerRolling", "IC2", "IC2:blockMachine2:4"); - addToStackMap("ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler", "IC2", "IC2:blockMachine2:5"); - addToStackMap("ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler", "IC2", "IC2:itemScrapbox"); - addToStackMap("ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler", "IC2", "IC2:blockMachine2:9"); - } - - if (Loader.isModLoaded("Ic2Nei")) { - addToStackMap("speiger.src.crops.prediction.NEIPlugin", "IC2CropsNEI", "IC2:blockCrop"); - } + public static void loadHandlerInfo() { + final boolean fromJar = NEIClientConfig.loadHandlersFromJar(); + NEIClientConfig.logger.info("Loading handler info from " + (fromJar ? "JAR" : "Config")); + handlerMap.clear(); + URL handlerUrl = Thread.currentThread().getContextClassLoader().getResource("assets/nei/csv/handlers.csv"); - // Gregtech 5u - if (!Loader.isModLoaded("gregapi_post") && Loader.isModLoaded("gregtech")) { - addToStackMap("gt.recipe.alloysmelter", "gregtech", "gregtech:gt.blockmachines:201"); // gt.blockmachines.basicmachine.alloysmelter.tier.01 - addToStackMap("gt.recipe.arcfurnace", "gregtech", "gregtech:gt.blockmachines:651"); // gt.blockmachines.basicmachine.arcfurnace.tier.01 - addToStackMap("gt.recipe.assembler", "gregtech", "gregtech:gt.blockmachines:211"); // gt.blockmachines.basicmachine.assembler.tier.01 - addToStackMap("gt.recipe.autoclave", "gregtech", "gregtech:gt.blockmachines:571"); // gt.blockmachines.basicmachine.autoclave.tier.01 - addToStackMap("gt.recipe.blastfurnace", "gregtech", "gregtech:gt.blockmachines:1000"); // gt.blockmachines.multimachine.blastfurnace - addToStackMap("gt.recipe.brewer", "gregtech", "gregtech:gt.blockmachines:491"); // gt.blockmachines.basicmachine.brewery.tier.01 - addToStackMap("gt.recipe.canner", "gregtech", "gregtech:gt.blockmachines:231"); // gt.blockmachines.basicmachine.canner.tier.01 - addToStackMap("gt.recipe.centrifuge", "gregtech", "gregtech:gt.blockmachines:361"); // gt.blockmachines.basicmachine.centrifuge.tier.01 - addToStackMap("gt.recipe.chemicalbath", "gregtech", "gregtech:gt.blockmachines:541"); // gt.blockmachines.basicmachine.chemicalbath.tier.01 - addToStackMap("gt.recipe.chemicalreactor", "gregtech", "gregtech:gt.blockmachines:421"); // gt.blockmachines.basicmachine.chemicalreactor.tier.01 - addToStackMap("gt.recipe.circuitassembler", "gregtech", "gregtech:gt.blockmachines:1180"); // gt.blockmachines.basicmachine.circuitassembler.tier.01 - addToStackMap("gt.recipe.cokeoven", "gregtech", "gregtech:gt.blockmachines:791"); // gt.blockmachines.industrialcokeoven.controller.tier.single - addToStackMap("gt.recipe.compressor", "gregtech", "gregtech:gt.blockmachines:241"); // gt.blockmachines.basicmachine.compressor.tier.01 - addToStackMap("gt.recipe.craker", "gregtech", "gregtech:gt.blockmachines:1160"); // gt.blockmachines.multimachine.cracker - addToStackMap("gt.recipe.cuttingsaw", "gregtech", "gregtech:gt.blockmachines:251"); // gt.blockmachines.basicmachine.cutter.tier.01 - addToStackMap("gt.recipe.distillationtower", "gregtech", "gregtech:gt.blockmachines:1126"); // gt.blockmachines.multimachine.distillationtower - addToStackMap("gt.recipe.distillery", "gregtech", "gregtech:gt.blockmachines:531"); // gt.blockmachines.basicmachine.distillery.tier.01 - addToStackMap("gt.recipe.electrolyzer", "gregtech", "gregtech:gt.blockmachines:371"); // gt.blockmachines.basicmachine.electrolyzer.tier.01 - addToStackMap("gt.recipe.electromagneticseparator", "gregtech", "gregtech:gt.blockmachines:561"); // gt.blockmachines.basicmachine.electromagneticseparator.tier.01 - addToStackMap("gt.recipe.extractor", "gregtech", "gregtech:gt.blockmachines:271"); // gt.blockmachines.basicmachine.extractor.tier.01 - addToStackMap("gt.recipe.extruder", "gregtech", "gregtech:gt.blockmachines:281"); // gt.blockmachines.basicmachine.extruder.tier.01 - addToStackMap("gt.recipe.fakeAssemblylineProcess", "gregtech", "gregtech:gt.blockmachines:1170"); // gt.blockmachines.multimachine.assemblyline - addToStackMap("gt.recipe.fermenter", "gregtech", "gregtech:gt.blockmachines:501"); // gt.blockmachines.basicmachine.fermenter.tier.01 - addToStackMap("gt.recipe.fluidcanner", "gregtech", "gregtech:gt.blockmachines:431"); // gt.blockmachines.basicmachine.fluidcanner.tier.01 - addToStackMap("gt.recipe.fluidextractor", "gregtech", "gregtech:gt.blockmachines:511"); // gt.blockmachines.basicmachine.fluidextractor.tier.01 - addToStackMap("gt.recipe.fluidheater", "gregtech", "gregtech:gt.blockmachines:621"); // gt.blockmachines.basicmachine.fluidheater.tier.01 - addToStackMap("gt.recipe.fluidsolidifier", "gregtech", "gregtech:gt.blockmachines:521"); // gt.blockmachines.basicmachine.fluidsolidifier.tier.01 - addToStackMap("gt.recipe.fusionreactor", "gregtech", "gregtech:gt.blockmachines:1193"); // gt.blockmachines.fusioncomputer.tier.06 - addToStackMap("gt.recipe.hammer", "gregtech", "gregtech:gt.blockmachines:611"); // gt.blockmachines.basicmachine.hammer.tier.01 - addToStackMap("gt.recipe.implosioncompressor", "gregtech", "gregtech:gt.blockmachines:12734"); // gt.blockmachines.electricimplosioncompressor - addToStackMap("gt.recipe.largechemicalreactor", "gregtech", "gregtech:gt.blockmachines:1169"); // gt.blockmachines.multimachine.chemicalreactor - addToStackMap("gt.recipe.laserengraver", "gregtech", "gregtech:gt.blockmachines:591"); // gt.blockmachines.basicmachine.laserengraver.tier.01 - addToStackMap("gt.recipe.lathe", "gregtech", "gregtech:gt.blockmachines:291"); // gt.blockmachines.basicmachine.lathe.tier.01 - addToStackMap("gt.recipe.macerator", "gregtech", "gregtech:gt.blockmachines:301"); // gt.blockmachines.basicmachine.macerator.tier.01 - addToStackMap("gt.recipe.magicfuels", "gregtech", "gregtech:gt.blockmachines:1123"); // gt.blockmachines.basicgenerator.magicenergyconverter.tier.01 - addToStackMap("gt.recipe.massfab", "gregtech", "gregtech:gt.blockmachines:461"); // gt.blockmachines.basicmachine.massfab.tier.01 - addToStackMap("gt.recipe.metalbender", "gregtech", "gregtech:gt.blockmachines:221"); // gt.blockmachines.basicmachine.bender.tier.01 - addToStackMap("gt.recipe.microwave", "gregtech", "gregtech:gt.blockmachines:311"); // gt.blockmachines.basicmachine.microwave.tier.01 - addToStackMap("gt.recipe.mixer", "gregtech", "gregtech:gt.blockmachines:581"); // gt.blockmachines.basicmachine.mixer.tier.01 - addToStackMap("gt.recipe.orewasher", "gregtech", "gregtech:gt.blockmachines:391"); // gt.blockmachines.basicmachine.orewasher.tier.01 - addToStackMap("gt.recipe.packager", "gregtech", "gregtech:gt.blockmachines:401"); // gt.blockmachines.basicmachine.boxinator.tier.01 - addToStackMap("gt.recipe.plasmaarcfurnace", "gregtech", "gregtech:gt.blockmachines:661"); // gt.blockmachines.basicmachine.plasmaarcfurnace.tier.01 - addToStackMap("gt.recipe.polarizer", "gregtech", "gregtech:gt.blockmachines:551"); // gt.blockmachines.basicmachine.polarizer.tier.01 - addToStackMap("gt.recipe.press", "gregtech", "gregtech:gt.blockmachines:601"); // gt.blockmachines.basicmachine.press.tier.01 - addToStackMap("gt.recipe.primitiveblastfurnace", "gregtech", "gregtech:gt.blockmachines:140"); // gt.blockmachines.multimachine.brickedblastfurnace - addToStackMap("gt.recipe.printer", "gregtech", "gregtech:gt.blockmachines:321"); // gt.blockmachines.basicmachine.printer.tier.01 - addToStackMap("gt.recipe.pyro", "gregtech", "gregtech:gt.blockmachines:1159"); // gt.blockmachines.multimachine.pyro - addToStackMap("gt.recipe.replicator", "gregtech", "gregtech:gt.blockmachines:481"); // gt.blockmachines.basicmachine.replicator.tier.01 - addToStackMap("gt.recipe.rockbreaker", "gregtech", "gregtech:gt.blockmachines:441"); // gt.blockmachines.basicmachine.rockbreaker.tier.01 - addToStackMap("gt.recipe.scanner", "gregtech", "gregtech:gt.blockmachines:341"); // gt.blockmachines.basicmachine.scanner.tier.01 - addToStackMap("gt.recipe.sifter", "gregtech", "gregtech:gt.blockmachines:641"); // gt.blockmachines.basicmachine.sifter.tier.01 - addToStackMap("gt.recipe.slicer", "gregtech", "gregtech:gt.blockmachines:631"); // gt.blockmachines.basicmachine.slicer.tier.01 - addToStackMap("gt.recipe.thermalcentrifuge", "gregtech", "gregtech:gt.blockmachines:381"); // gt.blockmachines.basicmachine.thermalcentrifuge.tier.01 - addToStackMap("gt.recipe.unpackager", "gregtech", "gregtech:gt.blockmachines:411"); // gt.blockmachines.basicmachine.unboxinator.tier.01 - addToStackMap("gt.recipe.vacuumfreezer", "gregtech", "gregtech:gt.blockmachines:1002"); // gt.blockmachines.multimachine.vacuumfreezer - addToStackMap("gt.recipe.wiremill", "gregtech", "gregtech:gt.blockmachines:351"); // gt.blockmachines.basicmachine.wiremill.tier.01 - addToStackMap("ic.recipe.recycler", "gregtech", "gregtech:gt.blockmachines:331"); // gt.blockmachines.basicmachine.recycler.tier.01 - addToStackMap("gt.recipe.uuamplifier", "gregtech", "gregtech:gt.blockmachines:471"); // Amplifabricator - - addToStackMap("gt.recipe.byproductlist", "gregtech", "gregtech:gt.metaitem.01:2019"); // Byproducts from ore processing - - addToStackMap("gt.recipe.dieselgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:1110"); // LV Combustion gen - addToStackMap("gt.recipe.extremedieselgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:2105"); // ECE, HOG-only - addToStackMap("gt.recipe.gasturbinefuel", "gregtech", "gregtech:gt.blockmachines:1115"); // LV gas turbine - addToStackMap("gt.recipe.largeboilerfakefuels", "gregtech", "gregtech:gt.blockmachines:1020"); // gt.blockmachines.multimachine.boiler.bronze - addToStackMap("gt.recipe.plasmageneratorfuels", "gregtech", "gregtech:gt.blockmachines:1196"); // gt.blockmachines.basicgenerator.plasmagenerator.tier.05 - addToStackMap("gt.recipe.semifluidboilerfuels", "gregtech", "gregtech:gt.blockmachines:1020"); // Bronze boiler - - addToStackMap("gt.recipe.smallnaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1190"); // Naq Reactor Mark I - addToStackMap("gt.recipe.largenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1191"); // Naq Reactor Mark II - addToStackMap("gt.recipe.fluidnaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1192"); // Naq Reactor Mark III. Misnamed in code - addToStackMap("gt.recipe.hugenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1188"); // Naq Reactor Mark IV. Slightly different name for recipe map - addToStackMap("gt.recipe.extrahugenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1189"); // Naq Reactor Mark V. Slightly different name for recipe map - //Fluid naq shares name with what should be huge, so it doesn't show up I guess. Also disabled. - - addToStackMap("gt.recipe.componentassembler", "gregtech", "gregtech:gt.blockmachines:211"); // GT++'s incomplete compound fabricator? - addToStackMap("gt.recipe.cncmachine", "gregtech", "gregtech:gt.metaitem.01:23305"); // Disabled CNC machine? - addToStackMap("gt.recipe.thermalgeneratorfuel", "gregtech", "IC2:blockGenerator:1"); // Disabled 'Thermal Generator'? Or compat for the IC2 geothermal? - } - - if (Loader.isModLoaded("appliedenergistics2")) { - addToStackMap("appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler", "AppliedEnergistics2","appliedenergistics2:item.ItemMultiPart:380"); - addToStackMap("appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler","AppliedEnergistics2", "appliedenergistics2:item.ItemMultiPart:380"); - addToStackMap("appeng.integration.modules.NEIHelpers.NEIFacadeRecipeHandler", "AppliedEnergistics2", "appliedenergistics2:item.ItemFacade:192"); - addToStackMap("appeng.integration.modules.NEIHelpers.NEIGrinderRecipeHandler", "AppliedEnergistics2","appliedenergistics2:item.ItemMultiMaterial:8"); - addToStackMap("appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler", "AppliedEnergistics2", "appliedenergistics2:tile.BlockInscriber"); - addToStackMap("appeng.integration.modules.NEIHelpers.NEIWorldCraftingHandler", "AppliedEnergistics2", "appliedenergistics2:item.ItemMultiMaterial:9"); - } - - if (Loader.isModLoaded("OpenComputers")) { - addToStackMap("li.cil.oc.integration.nei.ManualUsageHandler", "OpenComputers", "OpenComputers:item:98"); - addToStackMap("li.cil.oc.integration.nei.CallbackDocHandler", "OpenComputers", "OpenComputers:item:98"); - } - - if (Loader.isModLoaded("AdvancedSolarPanel")) { - addToStackMap("advsolar.client.nei.MTRecipeHandler", "AdvancedSolarPanel", "AdvancedSolarPanel:BlockMolecularTransformer"); - } - - if (Loader.isModLoaded("AromaBackup")) { - addToStackMap("aroma1997.core.recipes.nei.ShapedAromicRecipeHandler", "AromaBackup", "minecraft:crafting_table"); - addToStackMap("aroma1997.core.recipes.nei.ShapelessAromicRecipeHandler", "AromaBackup", "minecraft:crafting_table"); - } - - if (Loader.isModLoaded("WitcheryExtras")) { - addToStackMap("alkalus.main.nei.NEI_Handler_Cauldron", "witchery", "witchery:cauldron"); - addToStackMap("alkalus.main.nei.NEI_Handler_Distillery", "witchery", "witchery:distilleryidle"); - addToStackMap("alkalus.main.nei.NEI_Handler_Kettle", "witchery", "witchery:kettle"); - addToStackMap("alkalus.main.nei.NEI_Handler_Oven", "witchery", "witchery:witchesovenidle"); - addToStackMap("alkalus.main.nei.NEI_Handler_SpinningWheel", "witchery", "witchery:spinningwheel"); - } - - if (Loader.isModLoaded("BuildCraft|Silicon")) { - addToStackMap("buildcraft.compat.nei.RecipeHandlerAssemblyTable", "BuildCraft", "BuildCraft|Silicon:laserTableBlock"); - addToStackMap("buildcraft.compat.nei.RecipeHandlerIntegrationTable", "BuildCraft", "BuildCraft|Silicon:laserTableBlock:2"); - } - - if (Loader.isModLoaded("BuildCraft|Factory")) { - addToStackMap("buildcraft.compat.nei.RecipeHandlerRefinery", "BuildCraft", "BuildCraft|Factory:refineryBlock"); - } - - if (Loader.isModLoaded("Thaumcraft")) { - addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapedRecipeHandler", "Thaumcraft", "Thaumcraft:blockTable:15"); - addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapelessRecipeHandler", "Thaumcraft", "Thaumcraft:blockTable:15"); - addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.CrucibleRecipeHandler", "Thaumcraft", "Thaumcraft:blockMetalDevice"); - addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.InfusionRecipeHandler", "Thaumcraft", "Thaumcraft:blockStoneDevice:2"); - } - - if (Loader.isModLoaded("bartworks")) { - addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioLabHandler", "BartWorks", "gregtech:gt.blockmachines:12699"); - addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioVatHandler", "BartWorks", "gregtech:gt.blockmachines:12712"); - addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_OreHandler", "BartWorks", "bartworks:bw.blockores.01:89"); - - addToStackMap("gt.recipe.electricimplosioncompressor", "BartWorks", "gregtech:gt.blockmachines:12734"); // Electric implosion compressor - - addToStackMap("bw.recipe.cal", "BartWorks", "gregtech:gt.blockmachines:12735"); - - addToStackMap("bw.fuels.acidgens", "BartWorks", "gregtech:gt.blockmachines:12726"); - } - - if (Loader.isModLoaded("tectech")) { - addToStackMap("com.github.technus.tectech.nei.TT_NEI_ResearchHandler", "TecTech", "gregtech:gt.blockmachines:15331"); - addToStackMap("com.github.technus.tectech.nei.TT_NEI_ScannerHandler", "TecTech", "tectech:item.em.definitionScanStorage"); - } - - if (Loader.isModLoaded("ExtraUtilities")) { - addToStackMap("com.rwtema.extrautils.nei.EnderConstructorHandler", "ExtraUtilities", "ExtraUtilities:endConstructor"); - addToStackMap("com.rwtema.extrautils.nei.FMPMicroBlocksHandler", "ExtraUtilities", "ForgeMicroblock:sawIron"); - addToStackMap("com.rwtema.extrautils.nei.InfoHandler", "ExtraUtilities", "ExtraUtilities:chandelier"); - addToStackMap("com.rwtema.extrautils.nei.MicroBlocksHandler", "ExtraUtilities", "ExtraUtilities:microblocks:1"); - addToStackMap("com.rwtema.extrautils.nei.SoulHandler", "ExtraUtilities", "ExtraUtilities:mini-soul"); - } - - if (Loader.isModLoaded("EnderIO")) { - addToStackMap("crazypants.enderio.nei.AlloySmelterRecipeHandler", "EnderIO", "EnderIO:blockAlloySmelter"); - addToStackMap("crazypants.enderio.nei.EnchanterRecipeHandler", "EnderIO", "EnderIO:blockEnchanter"); - addToStackMap("crazypants.enderio.nei.SagMillRecipeHandler", "EnderIO", "EnderIO:blockSagMill"); - addToStackMap("crazypants.enderio.nei.SliceAndSpliceRecipeHandler", "EnderIO", "EnderIO:blockSliceAndSplice"); - addToStackMap("crazypants.enderio.nei.SoulBinderRecipeHandler", "EnderIO", "EnderIO:blockSoulBinder"); - addToStackMap("crazypants.enderio.nei.VatRecipeHandler", "EnderIO", "EnderIO:blockVat"); - } - - if (Loader.isModLoaded("extracells")) { - addToStackMap("extracells.integration.nei.UniversalTerminalRecipe", "ExtraCells", "extracells:part.base:9"); - } - - if (Loader.isModLoaded("Forestry")) { - addToStackMap("forestry.factory.recipes.nei.NEIHandlerBottler", "Forestry", "Forestry:factory"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerCarpenter", "Forestry", "Forestry:factory:1"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerCentrifuge", "Forestry", "Forestry:factory:2"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerFabricator", "Forestry", "Forestry:factory2"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerFermenter", "Forestry", "Forestry:factory:3"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerMoistener", "Forestry", "Forestry:factory:4"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerSqueezer", "Forestry", "Forestry:factory:5"); - addToStackMap("forestry.factory.recipes.nei.NEIHandlerStill", "Forestry", "Forestry:factory:6"); - } - - if (Loader.isModLoaded("Avaritia")) { - addToStackMap("fox.spiteful.avaritia.compat.nei.CompressionHandler", "Avaritia", "Avaritia:Neutronium_Compressor"); - addToStackMap("fox.spiteful.avaritia.compat.nei.ExtremeShapedRecipeHandler", "Avaritia", "Avaritia:Dire_Crafting"); - addToStackMap("fox.spiteful.avaritia.compat.nei.ExtremeShapelessRecipeHandler", "Avaritia", "Avaritia:Dire_Crafting"); - } - - if (Loader.isModLoaded("GalacticraftCore")) { - addToStackMap("galaxyspace.core.nei.rocket.RocketT1RecipeHandler", "Galacticraft", "GalacticraftCore:item.spaceship"); - } - - if (Loader.isModLoaded("GalacticraftMars")) { - addToStackMap("galaxyspace.core.nei.rocket.RocketT2RecipeHandler", "Galacticraft", "GalacticraftMars:item.spaceshipTier2:1"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT3RecipeHandler", "Galacticraft", "GalacticraftMars:item.itemTier3Rocket"); - } - - if (Loader.isModLoaded("GalaxySpace")) { - addToStackMap("galaxyspace.core.nei.AssemblyMachineRecipeHandler", "GalaxySpace", "GalaxySpace:assemblymachine"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT4RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier4Rocket"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT5RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier5Rocket"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT6RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier6Rocket"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT7RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier7Rocket"); - addToStackMap("galaxyspace.core.nei.rocket.RocketT8RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier8Rocket"); - } - - if (Loader.isModLoaded("ProjectBlue")) { - addToStackMap("gcewing.projectblue.nei.NEIRecipeHandler", "ProjectBlue", "ProjectBlue:sprayCan"); - } - /* GT++ */ - if (Loader.isModLoaded("miscutils")) { - addToStackMap("gtPlusPlus.nei.DecayableRecipeHandler", "GT++", "miscutils:dustRadium226"); - addToStackMap("gtPlusPlus.nei.GT_NEI_FlotationCell", "GT++", "gregtech:gt.blockmachines:31028"); - addToStackMap("gtPlusPlus.nei.GT_NEI_FluidReactor", "GT++", "gregtech:gt.blockmachines:998"); - addToStackMap("gtPlusPlus.nei.GT_NEI_MillingMachine", "GT++", "gregtech:gt.blockmachines:31027"); - - addToStackMap("gt.recipe.advanced.mixer", "GT++", "gregtech:gt.blockmachines:811"); - addToStackMap("gt.recipe.alloyblastsmelter", "gregtech", "gregtech:gt.blockmachines:810"); // ABS - addToStackMap("gt.recipe.cokeoven", "GT++", "gregtech:gt.blockmachines:791"); // ICO - addToStackMap("gt.recipe.cryogenicfreezer", "GT++", "gregtech:gt.blockmachines:910"); - addToStackMap("gt.recipe.cyclotron", "GT++", "gregtech:gt.blockmachines:828"); // Cyclotron - addToStackMap("gt.recipe.fishpond", "GT++", "gregtech:gt.blockmachines:829"); // Zhuhai - addToStackMap("gt.recipe.matterfab2", "GT++", "gregtech:gt.blockmachines:799"); - addToStackMap("gt.recipe.multicentrifuge", "GT++", "gregtech:gt.blockmachines:790"); - addToStackMap("gt.recipe.multielectro", "GT++", "gregtech:gt.blockmachines:796"); - addToStackMap("gt.recipe.vacfurnace", "GT++", "gregtech:gt.blockmachines:995"); - - addToStackMap("gt.recipe.lftr", "GT++", "gregtech:gt.blockmachines:751"); - addToStackMap("gt.recipe.lftr.2", "GT++", "gregtech:gt.blockmachines:751"); - - addToStackMap("gt.recipe.fissionfuel", "GT++", "gregtech:gt.blockmachines:835"); - addToStackMap("gt.recipe.geothermalfuel", "GT++", "gregtech:gt.blockmachines:830"); - addToStackMap("gt.recipe.rocketenginefuel", "GT++", "gregtech:gt.blockmachines:793"); // Basic (EV) rocket fuel gen - addToStackMap("gt.recipe.RTGgenerators", "GT++", "gregtech:gt.blockmachines:869"); // GT++ version of the RTG - addToStackMap("gt.recipe.semifluidgeneratorfuels", "GT++", "gregtech:gt.blockmachines:837"); // Semifluid gen - - addToStackMap("gt.recipe.chemicaldehydrator", "GT++", "gregtech:gt.blockmachines:911"); // Dehydrator - addToStackMap("gt.recipe.simplewasher", "GT++", "gregtech:gt.blockmachines:767"); - addToStackMap("gt.recipe.slowfusionreactor", "gregtech", "gregtech:gt.blockmachines:31015"); // gt.blockmachines.gtplusplus.fusion.single - } - - if (Loader.isModLoaded("Forestry")) { - addToStackMap("hellfirepvp.beebetteratbees.client.gui.BBABGuiRecipeTreeHandler", "Bees", "Forestry:beeQueenGE"); - } - - if (Loader.isModLoaded("RandomThings")) { - addToStackMap("lumien.randomthings.Handler.ModCompability.NEI.ImbuingStationRecipeHandler", "RandomThings", "RandomThings:imbuingStation"); - } - - if (Loader.isModLoaded("GalacticraftCore")) { - addToStackMap("micdoodle8.mods.galacticraft.core.nei.BuggyRecipeHandler", "Galacticraft", "GalacticraftCore:tile.rocketWorkbench"); - addToStackMap("micdoodle8.mods.galacticraft.core.nei.CircuitFabricatorRecipeHandler", "Galacticraft", "GalacticraftCore:tile.machine2:4"); - addToStackMap("micdoodle8.mods.galacticraft.core.nei.ElectricIngotCompressorRecipeHandler", "Galacticraft", "GalacticraftCore:tile.machine2"); - addToStackMap("micdoodle8.mods.galacticraft.core.nei.IngotCompressorRecipeHandler", "Galacticraft", "GalacticraftCore:tile.machine:12"); - addToStackMap("micdoodle8.mods.galacticraft.core.nei.RefineryRecipeHandler", "Galacticraft", "GalacticraftCore:tile.refinery"); - addToStackMap("micdoodle8.mods.galacticraft.planets.asteroids.nei.AstroMinerRecipeHandler", "Galacticraft", "GalacticraftCore:tile.rocketWorkbench"); - addToStackMap("micdoodle8.mods.galacticraft.planets.mars.nei.CargoRocketRecipeHandler", "Galacticraft", "GalacticraftCore:tile.rocketWorkbench"); - addToStackMap("micdoodle8.mods.galacticraft.planets.mars.nei.GasLiquefierRecipeHandler", "Galacticraft", "GalacticraftMars:tile.marsMachineT2"); - addToStackMap("micdoodle8.mods.galacticraft.planets.mars.nei.MethaneSynthesizerRecipeHandler", "Galacticraft", "GalacticraftMars:tile.marsMachineT2:4"); - } - - if (Loader.isModLoaded("ProjRed|Transmission")) { - addToStackMap("mrtjp.projectred.core.libmc.recipe.PRShapedRecipeHandler", "ProjectRed", "ProjRed|Transmission:projectred.transmission.wire:7"); - addToStackMap("mrtjp.projectred.core.libmc.recipe.PRShapelessRecipeHandler", "ProjectRed", "ProjRed|Transmission:projectred.transmission.wire:7"); - } - - if (Loader.isModLoaded("gendustry")) { - addToStackMap("net.bdew.gendustry.nei.ExtractorHandler", "Gendustry", "gendustry:Extractor"); - addToStackMap("net.bdew.gendustry.nei.ImprinterHandler", "Gendustry", "gendustry:Imprinter"); - addToStackMap("net.bdew.gendustry.nei.LiquifierHandler", "Gendustry", "gendustry:Liquifier"); - addToStackMap("net.bdew.gendustry.nei.MutagenProducerHandler", "Gendustry", "gendustry:MutagenProducer"); - addToStackMap("net.bdew.gendustry.nei.MutatronHandler", "Gendustry", "gendustry:Mutatron"); - addToStackMap("net.bdew.gendustry.nei.ReplicatorHandler", "Gendustry", "gendustry:Replicator"); - addToStackMap("net.bdew.gendustry.nei.SamplerHandler", "Gendustry", "gendustry:Sampler"); - addToStackMap("net.bdew.gendustry.nei.TemplateCraftingHandler", "Gendustry", "gendustry:GeneTemplate"); - addToStackMap("net.bdew.gendustry.nei.TransposerHandler", "Gendustry", "gendustry:Transposer"); - } - - if (Loader.isModLoaded("Botany")) { - addToStackMap("net.bdew.neiaddons.botany.flowers.FlowerBreedingHandler", "Botany", "Botany:flower"); - } - - if (Loader.isModLoaded("Forestry")) { - addToStackMap("net.bdew.neiaddons.forestry.bees.BeeBreedingHandler", "Forestry", "Forestry:beeQueenGE"); - addToStackMap("net.bdew.neiaddons.forestry.bees.BeeProduceHandler", "Forestry", "Forestry:beeQueenGE"); - addToStackMap("net.bdew.neiaddons.forestry.butterflies.ButterflyBreedingHandler", "Forestry", "Forestry:butterflyGE"); - addToStackMap("net.bdew.neiaddons.forestry.trees.TreeBreedingHandler", "Forestry", "Forestry:saplingGE"); - addToStackMap("net.bdew.neiaddons.forestry.trees.TreeProduceHandler", "Forestry", "Forestry:saplingGE"); - } - - if (Loader.isModLoaded("ae2wct")) { - addToStackMap("net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler", "WirelessCraftingTerminal", "ae2wct:wirelessCraftingTerminal"); - } - - if (Loader.isModLoaded("gregtech")) { - addToStackMap("pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5SmallOreStat", "Gregtech", "gregtech:gt.blockores:85"); - addToStackMap("pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5VeinStat", "Gregtech", "gregtech:gt.blockores:386"); - } - - if (Loader.isModLoaded("Thaumcraft")) { - addToStackMap("ru.timeconqueror.tcneiadditions.nei.arcaneworkbench.ArcaneCraftingShapedHandler", "Thaumcraft", "Thaumcraft:blockTable:15"); - addToStackMap("ru.timeconqueror.tcneiadditions.nei.AspectCombinationHandler", "Thaumcraft", "Thaumcraft:ItemResearchNotes"); - addToStackMap("ru.timeconqueror.tcneiadditions.nei.AspectFromItemStackHandler", "Thaumcraft", "Thaumcraft:ItemResearchNotes"); - } - - if (Loader.isModLoaded("TConstruct")) { - addToStackMap("tconstruct.plugins.nei.RecipeHandlerAlloying", "Tinker's Construct", "TConstruct:Smeltery"); - addToStackMap("tconstruct.plugins.nei.RecipeHandlerCastingBasin", "Tinker's Construct", "TConstruct:SearedBlock:2"); - addToStackMap("tconstruct.plugins.nei.RecipeHandlerCastingTable", "Tinker's Construct", "TConstruct:SearedBlock"); - addToStackMap("tconstruct.plugins.nei.RecipeHandlerDryingRack", "Tinker's Construct", "TConstruct:Armor.DryingRack"); - addToStackMap("tconstruct.plugins.nei.RecipeHandlerMelting", "Tinker's Construct", "TConstruct:LavaTank:2"); - addToStackMap("tconstruct.plugins.nei.RecipeHandlerToolMaterials", "Tinker's Construct", "TConstruct:ToolStationBlock"); - } - - if (Loader.isModLoaded("chisel")) { - addToStackMap("team.chisel.compat.nei.RecipeHandlerChisel", "Chisel", "chisel:chisel"); - } - - if (Loader.isModLoaded("harvestcraft")) { - addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerApiary", "Pam's Harvestcraft", "harvestcraft:apiary"); - addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerChurn", "Pam's Harvestcraft", "harvestcraft:churn"); - addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerOven", "Pam's Harvestcraft", "harvestcraft:oven"); - addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerPresser", "Pam's Harvestcraft", "harvestcraft:presser"); - addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerQuern", "Pam's Harvestcraft", "harvestcraft:quern"); - } - - if (Loader.isModLoaded("harvestcraft")) { - addToStackMap("tonius.neiintegration.mods.mcforge.RecipeHandlerFluidRegistry", "Minecraft", "minecraft:water"); - addToStackMap("tonius.neiintegration.mods.mcforge.RecipeHandlerOreDictionary", "Minecraft", "minecraft:iron_ore"); - } - - if (Loader.isModLoaded("Railcraft")) { - addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerBlastFurnace", "Railcraft", "Railcraft:machine.alpha:12"); - addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerCokeOven", "Railcraft", "Railcraft:machine.alpha:7"); - addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRockCrusher", "Railcraft", "Railcraft:machine.alpha:15"); - addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShaped", "Railcraft", "Railcraft:machine.alpha:8"); - addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShapeless", "Railcraft", "Railcraft:machine.alpha:8"); - } - /* Blood Magic */ - if (Loader.isModLoaded("AWWayofTime")) { - addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIAlchemyRecipeHandler", "BloodMagic", "AWWayofTime:blockWritingTable"); - addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIAltarRecipeHandler", "BloodMagic", "AWWayofTime:Altar"); - addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIBindingRitualHandler", "BloodMagic", "AWWayofTime:sacrificialKnife"); - addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIBloodOrbShapedHandler", "BloodMagic", "AWWayofTime:AlchemicalWizardrybloodRune:3"); - addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIBloodOrbShapelessHandler", "BloodMagic", "AWWayofTime:AlchemicalWizardrybloodRune:4"); - } - - if (Loader.isModLoaded("WitchingGadgets")) { - addToStackMap("witchinggadgets.client.nei.NEIInfernalBlastfurnaceHandler", "WitchingGadgets", "WitchingGadgets:WG_StoneDevice:2"); - addToStackMap("witchinggadgets.client.nei.NEISpinningWheelHandler", "WitchingGadgets", "WitchingGadgets:WG_WoodenDevice"); - } - /* Witchery */ - if (Loader.isModLoaded("witchery")) { - addToStackMap("com.emoniph.witchery.integration.NEICauldronRecipeHandler", "witchery", "witchery:cauldron"); - addToStackMap("com.emoniph.witchery.integration.NEISpinningWheelRecipeHandler", "witchery", "witchery:spinningwheel"); - addToStackMap("com.emoniph.witchery.integration.NEIWitchesOvenRecipeHandler", "witchery", "witchery:witchesovenidle"); - addToStackMap("com.emoniph.witchery.integration.NEIDistilleryRecipeHandler", "witchery", "witchery:distilleryidle"); - addToStackMap("com.emoniph.witchery.integration.NEIKettleRecipeHandler", "witchery", "witchery:kettle"); - } - /* Witchery Extras */ - if (Loader.isModLoaded("WitcheryExtras")) { - addToStackMap("alkalus.main.nei.NEI_Handler_Cauldron ", "witchery", "witchery:cauldron"); - addToStackMap("alkalus.main.nei.NEI_Handler_Distillery ", "witchery", "witchery:spinningwheel"); - addToStackMap("alkalus.main.nei.NEI_Handler_Kettle ", "witchery", "witchery:witchesovenidle"); - addToStackMap("alkalus.main.nei.NEI_Handler_Oven", "witchery", "witchery:distilleryidle"); - addToStackMap("alkalus.main.nei.NEI_Handler_SpinningWheel ", "witchery", "witchery:kettle"); - } - - - } - - private static void addToStackMap(String handler, String modname, String item_id) { - final ItemStack itemStack; - int meta = -1; - if (!item_id.contains(":")) { - NEIClientConfig.logger.info("Item ID missing colon for handler " + handler + " - " + modname); - return; - } - final String[] split = item_id.split(":"); - item_id = split[0] + ":" + split[1]; - - if(split.length >= 3) { - int mIdx = -1; - if (split[2].matches("\\d+")) { - mIdx = 2; - } else { - item_id += ":" + split[2]; - if (split.length >= 4) mIdx = 3; + URL url; + if (fromJar) { + url = handlerUrl; + if (url == null) { + NEIClientConfig.logger.info("Invalid URL for handlers csv."); + return; } - if (mIdx != -1) meta = Integer.parseInt(split[mIdx]); + } else { + File handlerFile = NEIClientConfig.handlerFile; + if(!handlerFile.exists()) { + NEIClientConfig.logger.info("Config file doesn't exit, creating"); + try { + assert handlerUrl != null; + ReadableByteChannel readableByteChannel = Channels.newChannel(handlerUrl.openStream()); + FileOutputStream fileOutputStream = new FileOutputStream(handlerFile.getAbsoluteFile()); + FileChannel fileChannel = fileOutputStream.getChannel(); + fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE); + } catch (IOException e) { + e.printStackTrace(); + return; + } + } + try { + url = NEIClientConfig.handlerFile.toURI().toURL(); + } catch (MalformedURLException e) { + NEIClientConfig.logger.info("Invalid URL for handlers csv (via config)."); + e.printStackTrace(); + return; + } + } + try { + BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream())); + CSVParser csvParser = CSVFormat.EXCEL.withFirstRecordAsHeader().parse(input); + for (CSVRecord record : csvParser) { + final String handler = record.get("handler"); + final String modName = record.get("modName"); + final String modId = record.get("modId"); + final boolean requiresMod = Boolean.parseBoolean(record.get("modRequired")); + final String excludedModId = record.get("excludedModId"); + + if (requiresMod && !Loader.isModLoaded(modId)) continue; + if (excludedModId != null && Loader.isModLoaded(excludedModId)) continue; + + + HandlerInfo info = new HandlerInfo(handler, modName, modId, requiresMod, excludedModId); + final String imageResource = record.get("imageResource"); + if(imageResource != null && !imageResource.equals("")) { + info.setImage(imageResource, + Integer.parseInt(record.get("imageX")), + Integer.parseInt(record.get("imageY")), + Integer.parseInt(record.get("imageWidth")), + Integer.parseInt(record.get("imageHeight")) + ); + } + if(!info.hasImageOrItem()) { + final String itemName = record.get("itemName"); + if (itemName != null && !itemName.equals("")) { + info.setItem(itemName, record.get("nbtInfo")); + } + } + final String yShift = record.get("yShift"); + if (yShift != null && !yShift.equals("")) + info.setYShift(Integer.parseInt(yShift)); + + try { + final int imageHeight = intOrDefault(record.get("handlerHeight"), HandlerInfo.DEFAULT_HEIGHT); + final int imageWidth = intOrDefault(record.get("handlerWidth"), HandlerInfo.DEFAULT_WIDTH); + final int maxRecipesPerPage = intOrDefault(record.get("maxRecipesPerPage"), HandlerInfo.DEFAULT_MAX_PER_PAGE); + info.setHandlerDimensions(imageHeight, imageWidth, maxRecipesPerPage); + } catch (NumberFormatException ignored) { + NEIClientConfig.logger.info("Error setting handler dimensions for " + handler); + } + + handlerMap.put(handler, info); + NEIClientConfig.logger.info("Loaded " + handler); + } + } catch (IOException e) { + NEIClientConfig.logger.info("Error parsing CSV"); + e.printStackTrace(); + } catch (Exception e) { + NEIClientConfig.logger.info("Error parsing CSV"); + e.printStackTrace(); + } - if (meta != -1) { - itemStack = GameRegistry.makeItemStack(item_id, meta, 1, ""); - } else { - itemStack = GameRegistry.findItemStack(split[0], split[1], 1); + } + + private static int intOrDefault(String str, int defaultValue) { + if (str == null || str.equals("")) return defaultValue; + try { + return Integer.parseInt(str); + } catch (NumberFormatException e) { + return defaultValue; } - if (itemStack != null) - stackMap.put(handler, new ImmutablePair<>(modname, itemStack)); - else - NEIClientConfig.logger.info("Couldn't find " + modname + " - " + item_id); - } - private static void addToIconMap(String handler, String modname, DrawableResource image) { - imageMap.put(handler, new ImmutablePair<>(modname, image)); } + + } diff --git a/src/codechicken/nei/recipe/HandlerInfo.java b/src/codechicken/nei/recipe/HandlerInfo.java new file mode 100644 index 00000000..e3efe9c0 --- /dev/null +++ b/src/codechicken/nei/recipe/HandlerInfo.java @@ -0,0 +1,136 @@ +package codechicken.nei.recipe; + +import codechicken.nei.NEIClientConfig; +import codechicken.nei.drawable.DrawableBuilder; +import codechicken.nei.drawable.DrawableResource; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.item.ItemStack; + +public class HandlerInfo { + public static int DEFAULT_HEIGHT = 65; + public static int DEFAULT_WIDTH = 166; + public static int DEFAULT_MAX_PER_PAGE = 2; + + private String handler; + + private String modName; + private String modId; + private boolean requiresMod = true; + private String excludedModId; + + private String itemId; + private String nbtString; + + private int yShift = 0; + private int height = DEFAULT_HEIGHT; + private int width = DEFAULT_WIDTH; + private int maxRecipesPerPage = DEFAULT_MAX_PER_PAGE; + + private ItemStack itemStack = null; + private DrawableResource image = null; + + public HandlerInfo(String handler, String modName, String modId, boolean requiresMod, String excludedModId) { + this.handler = handler; + this.modName = modName; + this.modId = modId; + this.requiresMod = requiresMod; + this.excludedModId = excludedModId; + } + + public void setHandlerDimensions(int height, int width, int maxRecipesPerPage) { + this.height = height; + this.width = width; + this.maxRecipesPerPage = maxRecipesPerPage; + } + + public boolean setItem(String itemId, String nbtString) { + if(hasImageOrItem()) + return false; + + int meta = -1; + if (!itemId.contains(":")) { + NEIClientConfig.logger.info("Item ID missing colon for handler " + handler + " - " + modName); + return false; + } + final String[] split = itemId.split(":"); + // ModID:ItemID + String itemLookupId = split[0] + ":" + split[1]; + + if(split.length >= 3) { + int mIdx = -1; + if (split[2].matches("\\d+")) { + mIdx = 2; + } else { + itemLookupId += ":" + split[2]; + if (split.length >= 4) mIdx = 3; + } + if (mIdx != -1) meta = Integer.parseInt(split[mIdx]); + } + + if (meta != -1) { + itemStack = GameRegistry.makeItemStack(itemLookupId, meta, 1, nbtString == null ? "" : nbtString); + } else { + itemStack = GameRegistry.findItemStack(split[0], split[1], 1); + } + if (itemStack == null) + NEIClientConfig.logger.info("Couldn't find " + modName + " - " + itemLookupId); + else { + this.itemId = itemId; + this.nbtString = nbtString; + } + return (itemStack != null); + } + + public boolean setImage(String resourceLocation, int imageX, int imageY, int imageWidth, int imageHeight) { + if(hasImageOrItem()) + return false; + + this.image = new DrawableBuilder(resourceLocation, imageX, imageY, imageWidth, imageHeight).build(); + return true; + } + + public DrawableResource getImage() { + return image; + } + + public ItemStack getItemStack() { + return itemStack; + } + + public String getModName() { + return modName; + } + + public String getModId() { + return modId; + } + + + public int getHeight() { + return height; + } + + public int getWidth() { + return width; + } + + public int getMaxRecipesPerPage() { + return Math.max(maxRecipesPerPage, 1); + } + + public int getYShift() { + return yShift; + } + + public boolean hasImageOrItem() { + if (image != null) return true; + if (itemStack != null) return true; + + return false; + } + + + public void setYShift(int yShift) { + this.yShift = yShift; + } +}