Jump to content

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


Recommended Posts

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

Posted

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

Posted

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

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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