Jump to content

Recommended Posts

Posted

On the RegistryEvent.Register<Item> event I made a substitution alias: GameRegistry.addSubstitutionAlias("minecraft:map", GameRegistry.Type.ITEM, myEmptyMap); where myEmptyMap is an instance of com.example.MyEmptyMap that extends net.minecraft.item.ItemEmptyMap.

In The constructor of net.minecraft.item.ItemEmptyMap there is the call to setCreativeTab(CreativeTabs.MISC); so I left my constructor empty.

Why in the misc tab there are 2 minecraft:map items? How can i remove one?

 

Thx

 

Posted (edited)

I reported this here, cpw isn't intending to fix it.

 

You can probably set the vanilla Item's creative tab to null before you substitute it to prevent it from showing up in the creative menu.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
4 hours ago, Choonster said:

I reported this here, cpw isn't intending to fix it.

 

You can probably set the vanilla Item's creative tab to null before you substitute it to prevent it from showing up in the creative menu.

As cpw said this is a sided effect so the method addSubstitutionAlias must be called only in server side. The solution is to  remove it from client proxy.

Thx

Posted
11 minutes ago, Zacomat said:

As cpw said this is a sided effect so the method addSubstitutionAlias must be called only in server side. The solution is to  remove it from client proxy.

Thx

 

He said it's a side effect, not a sided effect.

 

This has nothing to do with the client/server sides.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I tried this but it does not work:

 

@SubscribeEvent

public void onRegisterEvent(RegistryEvent.Register<Item> event) {

   Items.MAP.setCreativeTab(null);

    try {

             GameRegistry.addSubstitutionAlias("minecraft:map", GameRegistry.Type.ITEM, MyMod.myEmptyMap);

         } catch (ExistingSubstitutionException e) {

        e.printStackTrace();

    }

}

 

Still 2 items in the misc tab.

Posted

Looking into this further, the original Item is never returned by the registry iterator used in CreativeTabs#displayAllRelevantItems; the substitution is returned twice. This explains why setting the creative tab of the original Item doesn't work.

 

I'm not sure if there's any way to fix this.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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