Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

  • 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

 

 

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.

  • 1 year later...

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.