Jump to content

[1.13.2][SOLVED] Registries limits?


Krevik

Recommended Posts

1. Stop using BlockBase.

2. Stop using ItemBase.

3. Where did you register your registerBlocks and registerItems method? Are they being called?

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

7 hours ago, DavidM said:

1. Stop using BlockBase.

2. Stop using ItemBase.

3. Where did you register your registerBlocks and registerItems method? Are they being called?

BlockBase and ItemBase are used to register block and items easier, the code is easier to read, than vanilla one - aren't some conventions pointing that the code should be easy to read? Without them I would have to call Block.Properties.create, every time I create new Block. The code is pretty long then, so I created some more simple constructor.

 

They're all registred in RegistryHelper.
 

    @SubscribeEvent
    public static void registerBlocks(final RegistryEvent.Register<Block> event){
        final IForgeRegistry<Block> registry = event.getRegistry();
        for(Block block: KBlocks.blockRegistryList){
            registry.register(block);
        }
    }

    @SubscribeEvent
    public static void registerItems(final RegistryEvent.Register<Item> event){
        final IForgeRegistry<Item> registry = event.getRegistry();
        for(ItemBlock itemBlock:KBlocks.itemBlocksRegistryList){
            final Block block = itemBlock.getBlock();
            final ResourceLocation registryName = Preconditions.checkNotNull(block.getRegistryName(), "Block %s has null registry name", block);
            ItemBlock itemBlock1 = (ItemBlock) new ItemBlock(block,new Item.Properties().group(itemBlock.getGroup())).setRegistryName(registryName);
            registry.register(itemBlock1);
        }
        for(Item item: KItems.itemsToRegister){
         registry.register(item);
        }
        registry.register(new ItemBlock(KBlocks.KATHARIAN_PORTAL,new Item.Properties().group(KathairisItemGroups.kathairis_building_blocks)).setRegistryName(KBlocks.KATHARIAN_PORTAL.getRegistryName().toString()));
    }

Yes, register method are being called, cause as I said most of blocks works, just some of them are skipped. Even if I try to register them manually, they're not succesfully registred

Edited by Krevik
Link to comment
Share on other sites

22 minutes ago, Krevik said:
7 hours ago, DavidM said:

1. Stop using BlockBase.

2. Stop using ItemBase.

3. Where did you register your registerBlocks and registerItems method? Are they being called?

BlockBase and ItemBase are used to register block and items easier, the code is easier to read, than vanilla one - aren't some conventions pointing that the code should be easy to read? Without them I would have to call Block.Properties.create, every time I create new Block. The code is pretty long then, so I created some more simple constructor.

1. No. In fact, the convention in terms of modding is against using BlockBase and ItemBase. They are an anti-pattern. I've linked some posts from others down below explaining why Block/ItemBases should not be used:

http://www.minecraftforge.net/forum/topic/68881-onblockactivated-not-being-called/?tab=comments#comment-332831

http://www.minecraftforge.net/forum/topic/68429-ore-variant-textures-not-working-properly/?tab=comments#comment-330456

In conclusion, there is already a BlockBase, it is called Block; you shouldn't be using inheritance just to write less code; extending from bases prevents you from extending from other stuff.

 

2. Check your log. Are there any errors during registry? If all of your blocks are in the list, then the problem is probably that some blocks failed to register. Try adding debug lines.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

11 minutes ago, DavidM said:

1. No. In fact, the convention in terms of modding is against using BlockBase and ItemBase. They are an anti-pattern. I've linked some posts from others down below explaining why Block/ItemBases should not be used:

http://www.minecraftforge.net/forum/topic/68881-onblockactivated-not-being-called/?tab=comments#comment-332831

http://www.minecraftforge.net/forum/topic/68429-ore-variant-textures-not-working-properly/?tab=comments#comment-330456

In conclusion, there is already a BlockBase, it is called Block; you shouldn't be using inheritance just to write less code; extending from bases prevents you from extending from other stuff.

 

2. Check your log. Are there any errors during registry? If all of your blocks are in the list, then the problem is probably that some blocks failed to register. Try adding debug lines.

Yea, been checking logs really long actually. They're just skipped, no errors. Katharian_Multi_Grass, blue_cloud_bricks and yellow_cloud_block. Blue_Cloud_bricks and Yellow_Cloud_Block are extending BlockBase, so the same registration methods are used.

Edited by Krevik
Link to comment
Share on other sites

Maybe try something like this in your main class:

 

 // Register Items
        FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(Item.class,this::onItemsRegistry);
  private void onItemsRegistry(final RegistryEvent.Register<Item> itemRegistryEvent) {
        LOGGER.info("Registering Items...");
        ModItems.register(itemRegistryEvent);
    }

 

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

    • Hello there! I am trying to make custom dimensions for a modpack I am making in an older minecraft version, 1.16.5. I like that version and it has a few other mods that have not been updated that I would still like to use. Anyway, I am having a terrible time with getting my dimension to work and have tried using code from other peoples projects to at least figure out what I'm supposed to be doing but it has not been as helpful as I would have liked. If anyone could help that would be greatly appreciated! Here is my github with all the code as I am using it: https://github.com/BladeColdsteel/InvigoratedDimensionsMod I have also included the last log, https://pastebin.com/zX9vsDSq, I had when I tried to load up a world, let me know if there is anything else I should send though, thank you!
    • Whether you are a fan of Hypixel Bedwars, SkyWars and PvP gamemodes like that, well you would enjoy this server! We have a very fun and unique style of PvP that a lot of our players really enjoy and we want to bring this server to more players like you! Yes you reading this post haha. Introducing, the Minezone Network, home of SUPER CRAFT BLOCKS. We've been working on this server for over 4 years now. Here is what we have to offer: SUPER CRAFT BLOCKS: This has 3 different gamemodes you can play, Classic, Duels and Frenzy. Each mode offers over 60 kits to choose from, along with a total of over 60 maps, allowing for various different playstyles on each map. There are also random powerups that spawn on the map which can include Health Pots, Bazookas, Nukes, Extra Lives and way way more! There is also double jump in this gamemode as well, which makes PvP a lot more fun & unique. You only need a minimum of 2 players to start any mode! Classic: Choose a kit, 5 lives for each player, fight it out and claim the #1 spot! Look out for lightning as they can spawn powerups to really give you an advantage in the game! Duels: Fight against another random player or one of your friends and see who is the best! Frenzy: Your kit is randomly selected for you, each life you will have a different kit. You can fight with up to 100 players in this mode and lets see who will be the best out of that 100! All the other stuff from Classic/Duels apply to this mode as well like powerups. We have 2 ranks on this server too, VIP and CAPTAIN which has a bunch of different perks for SCB and other things like Cosmetics and more.   SERVER IP: If this server has caught your interest in any way, please consider joining and you will NOT regret it! Bring some of your friends online for an even better experience and join in on the fun at: IP: minezone.club Hope to see you online!   SERVER TRAILER: https://www.youtube.com/watch?v=0phpMgu1mH0
    • The mod give new blocks  
    • I will a Mode for 1.21 in this Mod give new block, items and dimensions   
  • Topics

×
×
  • Create New...

Important Information

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