Jump to content

Item Creative Tab Ordering


skip999

Recommended Posts

Hello,

I am working on getting my mod ready for an alpha release. One of the things I would like to polish before doing so is the order the items and blocks appear in the creative tab. There seems to be no rhyme or reason to it. I thought it might be the order in which I define the objects, but that doesn't seem to be the case, as the order doesn't change when I move the object definition around in the iteminit class. Can anyone help me with this?

 

Here is a link to the project on github: https://github.com/skiprocks999/Amulets-of-Infinity/tree/Block-Library

Link to comment
Share on other sites

33 minutes ago, skip999 said:

Would I put it in the init package or does it go in the mod class?

It doesn't matter where you put the class, packages are just for sorting.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

Okay so out the door I have run into a problem. I go to extend "CreativeTabs", and the class does not exist. The only two options I am presented (three if you include the create a class one) is either "CreativeScreen" or "CreativeSettings". Am I taking what the post is saying to literally? I am in 1.15.2 for my mod version, so its possible the name has just changed.

Link to comment
Share on other sites

Okay so on the forum post diesie listed above, the override appears to include having a list where you manually put in every item in the mod. I am using defferedregistries, so where it states:

 

              List<Item> items = Arrays.asList(your_item_1, your_item_2, ...);

 

could I simply have:

 

             List<Item> items = null;

             items.addAll(ITEMS);

 

this way when I add or remove an item I do not have to also modify the creative tab extension class in my main mod class

 

(for reference the defferedregister for my items is named ITEMS)

Link to comment
Share on other sites

So I have hit a bit of a snag. I was able to get it working for the item library just fine. However, I cannot seem to figure out how to get it to work for my block library. The main issue is that I am using deferredregistries, so I only have the blocks defined in the init class. In my main mod class, I have a method that generates the block items for me, which I have listed here:

 

    public static void onRegisterItems(final RegistryEvent.Register<Item> event) {
                
        final IForgeRegistry<Item> registry = event.getRegistry();
        
        List<BlockItem> blockItems = new ArrayList<BlockItem>();
        
        BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block ->   {
            final Item.Properties properties =
                    new Item.Properties().group(ContInfBlockLibItemGroup.itemGroupInstance);
            final BlockItem blockItem = new BlockItem(block,properties);
            blockItem.setRegistryName(block.getRegistryName());
            blockItems.add(blockItem);
            registry.register(blockItem);
        });
        
        logger.debug("Registered BlockItems");
    }

 

I have attempted to get a list of the block items out of the method, but to no avail. How would I go about doing that?

 

Link to comment
Share on other sites

Here is my code for extracting the list of blocks from the registry:
            Object[] listOfBlocks = BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).toArray();
            List<Block> blockItems= new ArrayList<Block>();
            for(int i = 0; i < listOfBlocks.length;i++) {
                blockItems.add((Block)listOfBlocks);
            }

I am not seeing any option for blocktoitem on any of the entries in the blockItems list, nor can I find any documentation online on how I would use it. How would I apply it? And where would I apply it?

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Akun Pro Kamboja adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot Maxwin dengan transaksi mudah menggunakan Bank Lampung. Berikut adalah beberapa alasan mengapa Anda harus memilih Akun Pro Kamboja: Slot Maxwin Terbaik Kami menyajikan koleksi slot Maxwin terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Lampung Kami menyediakan layanan transaksi mudah melalui Bank Lampung untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Anti Rungkat Akun Pro Kamboja memberikan jaminan "anti rungkat" kepada para pemainnya. Dengan fitur ini, Anda dapat merasakan sensasi bermain dengan percaya diri, karena kami memastikan pengalaman bermain yang adil dan menyenangkan bagi semua pemain.  
    • BINGO188: Destinasi Terbaik untuk Pengalaman Slot yang Terjamin Selamat datang di BINGO188, tempat terbaik bagi para pecinta slot yang mencari pengalaman bermain yang terjamin dan penuh kemenangan. Di sini, kami menawarkan fitur unggulan yang dirancang untuk memastikan kepuasan dan keamanan Anda. Situs Slot Garansi Kekalahan 100 Kami memahami bahwa kadang-kadang kekalahan adalah bagian dari permainan. Namun, di BINGO188, kami memberikan jaminan keamanan dengan fitur garansi kekalahan 100. Jika Anda mengalami kekalahan, kami akan mengembalikan saldo Anda secara penuh. Kemenangan atau uang kembali, kami memastikan Anda tetap merasa aman dan nyaman. Bebas IP Tanpa TO Nikmati kebebasan bermain tanpa batasan IP dan tanpa harus khawatir tentang TO (Turn Over) di BINGO188. Fokuslah pada permainan Anda dan rasakan sensasi kemenangan tanpa hambatan. Server Thailand Paling Gacor Hari Ini Bergabunglah dengan server terbaik di Thailand hanya di BINGO188! Dengan tingkat kemenangan yang tinggi dan pengalaman bermain yang lancar, server kami dijamin akan memberikan Anda pengalaman slot yang tak tertandingi. Kesimpulan BINGO188 adalah pilihan terbaik bagi Anda yang menginginkan pengalaman bermain slot yang terjamin dan penuh kemenangan. Dengan fitur situs slot garansi kekalahan 100, bebas IP tanpa TO, dan server Thailand paling gacor hari ini, kami siap memberikan Anda pengalaman bermain yang aman, nyaman, dan menguntungkan. Bergabunglah sekarang dan mulailah petualangan slot Anda di BINGO188!
    • Mengapa Memilih AlibabaSlot? AlibabaSlot adalah pilihan terbaik bagi Anda yang mencari slot gacor dari Pgsoft dengan transaksi mudah menggunakan Bank Panin. Berikut adalah beberapa alasan mengapa Anda harus memilih AlibabaSlot: Slot Gacor dari Pgsoft Kami menyajikan koleksi slot gacor terbaik dari Pgsoft. Dengan fitur-fitur unggulan dan peluang kemenangan yang tinggi, setiap putaran permainan akan memberikan Anda kesenangan dan keuntungan yang maksimal. Transaksi Mudah dengan Bank Panin Kami menyediakan layanan transaksi mudah melalui Bank Panin untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa masalah.  
    • Delete the jei-server.toml file in your config folder and test it again
    • java.util.ConcurrentModificationException at java.base/java.util.HashMap.computeIfAbsent(Unknown Source) at Genesis//com.moonsworth.lunar. ... Looks like an issue with the Launcher - Make a test with another Launcher like MultiMC, AT Launcher or Technic Launcher or try the original one
  • Topics

×
×
  • Create New...

Important Information

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