Posted November 16, 201212 yr hey is there a way to be able to hide items/block from showing in NEI/TMI completed thanks
November 17, 201212 yr Well, I can tell you how I hide items from NEI. Make a package in your client side package called: codechicken.nei.api Make a new class called: API Paste this in: package codechicken.nei.api; public class API { public static void hideItem(int id) { } } Then in both your proxy's, add this: public void doNEICheck(int id) {} Then in your Client proxy, add this to the body of that method(DO NOT IMPORT codechicken.nei.api!!!): if (Minecraft.getMinecraft().thePlayer != null ) { Iterator modsIT = Loader.instance().getModList().iterator(); ModContainer modc; while (modsIT.hasNext()) { modc = (ModContainer) modsIT.next(); if ("Not Enough Items".equals(modc.getName().trim())) { codechicken.nei.api.API.hideItem(id); return; } } } When you release, DO NOT INCLUDE the codechicken.nei.api package. Players with NEI will already have it, and IT will do the hiding for you. Players who don't have nei will never reach the statement to error out. Edit: Oh almost forgot, see how i check if the player exists? I do this because I remove the items after the player loads a world, this ensures your items are removed after nei adds them, and that idresolver hasn't changed any of your ID's in between.
November 17, 201212 yr Author thanks a lot also how do u set it so that only certain IDs will not be shown because there is only going to be 2 or 3 items not shown in NEI
November 17, 201212 yr Uh you do realize you have to pass the id's of the blocks you want to hide to your proxies via Mod.proxy.doNEICheck(blockOrItemIDToHide) right? My example won't work unless the world is already loaded, you can put the call in a tick, and toggle a boolean to disable the call if it succeeds. I don't know what would happen if you try to remove an ID that doesn't exist, probably nothing, but there is no point and is a waste of resources.
June 27, 201411 yr where do i place the id and what id do i use(you cant for example do minecraft:stone)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.