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.

[SOLVED] Noob-Problem with GameRegistry.registerBlock / LanguageRegistry.addName

Featured Replies

Posted

Hi there!

 

I'm new here and started modding for minecraft a few days ago. My first language is german but I can READ english very well. Writing is still very wired :)

 

My Problem locates in the main mod-file. I created a few dummy-blocks and generated them in the ground. All works perfect. After that I came over to flowers. Adding them as Blocks looked somehow wired :D They show up as a normal block and not as a crosstexture. So I figured out, that there is a class called BlockFlower. Once I created my flowers as BlockFlowers, everything worked as it should work. The flowers generated all over the land. Next thing was: Adding a second flower... all worked nice... except:

 

Now I have the problem, that I created 3 flowers and in creativeTab they all have the same name. I changed a lot and wanted to figure out what the problem is, but I got stuck. Would someone please help me out?! Would be nice!

 

The important parts of the mod-file:

 

 

...

        public static final Block TNKmodBlock = new TNKmodBlock(1001, Material.rock);

        public static final Block TNKmodRock = new TNKmodRock(1004, Material.rock);

        public static final BlockFlower TNKmodFB = new TNKmodFB(1005);

        public static final BlockFlower TNKmodFlower = new TNKmodFlower(1002);

        public static final BlockFlower TNKmodFarn = new TNKmodFarn(1003);

...

        @Init

        public void load(FMLInitializationEvent event) {

            GameRegistry.registerBlock(TNKmodBlock, "TNKmodBlock");

            GameRegistry.registerBlock(TNKmodRock, "TNKmodRock");

            GameRegistry.registerBlock(TNKmodFlower, "TNKmodFlower");

            GameRegistry.registerBlock(TNKmodFarn, "TNKmodFarn");

            GameRegistry.registerBlock(TNKmodFB, "TNKmodFB");

           

            LanguageRegistry.addName(TNKmodBlock, "modBlock");

            LanguageRegistry.addName(TNKmodRock, "modRock");

            LanguageRegistry.addName(TNKmodFlower, "modFlower");

            LanguageRegistry.addName(TNKmodFarn, "modFarn");

            LanguageRegistry.addName(TNKmodFB, "modFB");

           

            LanguageRegistry.addName(TNKmodItem, "modItem");

 

        GameRegistry.registerWorldGenerator(new WorldGeneration(1001,0));

        GameRegistry.registerWorldGenerator(new WorldGeneration(1004,0));

        GameRegistry.registerWorldGenerator(new FlowerGeneration(1005));

        GameRegistry.registerWorldGenerator(new FlowerGeneration(1002));

        GameRegistry.registerWorldGenerator(new FlowerGeneration(1003));

 

 

 

With kind regards!

Tankwart

  • Author

Hi mnn!

 

Damn, this easy... Sorry for the silly question! Yes exactly this is the problem! I forgot the setUnlocalizedName. ::) Thank you very much for the help!

 

With kind regards!

Tankwart

 

@ADMIN: Problem is solved and thread can be closed. Due to the fact, that it was a silly question, it's on you to delete it. ;)

@ADMIN: Problem is solved and thread can be closed. Due to the fact, that it was a silly question, it's on you to delete it. ;)

 

I think you can close your own threads.

You can also edit your original post to put "SOLVED" in the title.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Hi Draco18s!

 

I haven't seen this before in any other forum and was a little bit afraid clicking on it. In this case, I will do! Thanks!

 

Greets

Tankwart

Guest
This topic is now closed to further replies.

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.