Jump to content

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


Tankwart

Recommended Posts

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

Link to comment
Share on other sites

Are you setting a name of your block(s) - setUnlocalizedName? The name in registerBlock method is imo just for FML, but the unlocalizedName is used by LanguageRegistry to look-up a title for GUI.

 

similar (or same?) topic - http://www.minecraftforge.net/forum/index.php/topic,7798.msg39631.html

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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