[SOLVED} Help with: Hide the Recipe for my Item from NEI

Discussion in 'Mod Development' started by Type1Ninja, Jun 13, 2015.

  1. Type1Ninja

    Type1Ninja New Member

    [SOLVED]
    First reply has solution

    Firstly: I googled this, and all that came up was a bunch of stuff about users (not modders) reducing the page count in NEI. I also searched the forum; nothing came up. :p

    I'm using Minecraft 1.7.10 and Forge v1.7.10-10.13.2.1291.
    I'm just learning to mod (specifically from Pahimar's Let's Mod Reboot tutorial), and I've got an item with a recipe. I want the item to be secret, so I'd like to hide the recipe (but not the item) from NEI. Is there a way to do that?

    One other question, not-fully-related to this topic:
    How do I make code that only executes if a certain mod is found in the environment? This is specifically for adding something using an item from another mod.
    (I'll post that again in it's own thread if I can't find anything from google; it'd be nice to have some up to date info from someone experienced, though)
     
    Last edited: Jun 14, 2015
  2. goldenapple

    goldenapple Well-Known Member Mod Developer

    This one is easy:
    Code:
    if(Loader.isModLoaded(String modid)){
       //stuff
    }
    You should be able to find the mod id via the "Mods" list in the main menu.

    Not exactly sure how to do this. One cheaty way to do it is to make your own recipe class, an exact copy of ShapedOreRecipe. (NEI won't recognize it because it will be a different class). Then you should be able to use it like this:
    Code:
    RecipeSorter.register("modid:hiddenshaped", HiddenShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");
    
    GameRegistry.addRecipe(new HiddenShapedRecipe( //your recipe));
    
     
    Type1Ninja likes this.
  3. Type1Ninja

    Type1Ninja New Member

    Thankyouthankyouthankyouthankyouthankyou. :D
    This is exactly what I want, and definitely well within my ability set. :)

    EDIT: how do you do code tags?
     
    Last edited: Jun 14, 2015
    goldenapple likes this.
  4. SatanicSanta

    SatanicSanta New Member

    [code][/code]
     
    Type1Ninja likes this.

Share This Page