Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
drkoaeg

GameRegistry worldgen trees

15 posts in this topic

 What are the used names of TFC trees registered through forge cpw.mods.fml.common.registry.GameRegistry; class (Wood logs)? I used the block names from src code (terrafirmacraft.BlockLogNatural) , but it does not work. Please help me out, same with tree saplings (terrafirmacraft.ItemSapling). Thank you for some more information =)

 

~drkoaeg

0

Share this post


Link to post
Share on other sites

What exactly do you need them for? Are you just looking for the unlocalized name?

0

Share this post


Link to post
Share on other sites
45 minutes ago, Kittychanley said:

What exactly do you need them for? Are you just looking for the unlocalized name?

I am trying to provide mod compatibility for TFC amongst other mods. Therefor I use findBlock command in registry. Searching for "terrafirmacraft" and the logs/saplings. It is used for recognizing TFC trees by the mod, so these trees will be available for growing and death. So I think the unlocalized name should be found?


 
0

Share this post


Link to post
Share on other sites

Are you writing this compatibility mod, or is this for a config file for a mod somebody else wrote? I'm not familiar with the findBlock command with the registry. I know that most config files want the unlocalized name, which would just be terrafirmacraft:sapling terrafirmacraft:sapling2 terrafirmacraft:log and terrafirmacraft:log2. All the other ones like WoodVert are for player placed logs, not trees.

0

Share this post


Link to post
Share on other sites
On 12.5.2016 at 10:19 PM, Kittychanley said:

Are you writing this compatibility mod, or is this for a config file for a mod somebody else wrote?

I am helping with a mod of somebody else to bring TFC support. So it is no config thing.

 
Edited by drkoaeg
0

Share this post


Link to post
Share on other sites

Thank you for the unlocalized names, sadly, that did not work :(

0

Share this post


Link to post
Share on other sites

Looking at the syntax you provided in the example, I would assume the correct way would be to simply do

Block b = GameRegistry.findBlock("terrafirmacraft", "sapling");

I know for loading blocks out of the config files in TFC we use Block.getBlockFromName instead of GameRegistry.findBlock

It's also very important to note that all of those method parameters are case-sensitive.

0

Share this post


Link to post
Share on other sites
1 hour ago, Kittychanley said:

Block b = GameRegistry.findBlock("terrafirmacraft", "sapling");

Thank you for for clarifying. I did it this way, so this will not work, I might use Block.getBlockFromName. Do you mean with case sensitive, that if there is another log for example, the name might change to let's say log2_1? Or does even more possibly happen?

0

Share this post


Link to post
Share on other sites

By case sensitive, I mean that it will only recognize "terrafirmacraft" it will not recognize "TerraFirmaCraft" the same goes for "log" versus "Log"

0

Share this post


Link to post
Share on other sites

Oh I see. Yes, I was little suprised that the unlocalized names were written lower case, but I tried it exactly as you spellt, of course. I did not think that it is that difficult to bring mod support^^  I digged a bit in the src code, might this be written upper case?

if(Loader.isModLoaded("terrafirmacraft")) {

IntegrationTFC.registerTFCTrees();

}

0

Share this post


Link to post
Share on other sites

That also needs to be written in lowercase. "terrafirmacraft" is the string that we use as our modID, and all of the string comparisons are strictly case sensitive. This is fairly normal convention afaik in java programming unless you are dealing with direct user input. It also allows for two different mods to have the same modID, but capitalized differently.

0

Share this post


Link to post
Share on other sites

Thank you for explanation. Okay, so that is all right, hmm...

Edited by drkoaeg
0

Share this post


Link to post
Share on other sites

Okay, found the problem, the unlocalized names work, but the tree check also looks for the dirt underneath the tree block. So Kitty, could you give me this one, too?

0

Share this post


Link to post
Share on other sites

There's a bunch of different ways you can find the unlocalized name for anything. Outside of the game, you can look at the lang files: https://github.com/Deadrik/TFCraft/blob/master/src/Resources/assets/terrafirmacraft/lang/en_US.lang

The format is type.unlocalized_name.variation.name. For item's you need the item.unlocalized_name and ignore everything beyond that. For blocks you can ignore the beginning "tile." part.

Inside the game, if you know the number ID of the object, you can do "/give @p number" and the chat will tell you the unlocalized name when it gives it to you. If you have Inventory Tweaks installed, you can just do F3+H and everything will show their unlocalized name in the tooltip. If you have NEI installed, you can do a data dump that creates a csv file with all of the unlocalized names in it.

0

Share this post


Link to post
Share on other sites