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

[Request] Addon Devlopment Guide

136 posts in this topic

Is you add-on in the sub-folder TFCTemplateMod?

0

Share this post


Link to post
Share on other sites

yes, I never bothered to change the name of the base folder when I changed all the names elsewhere.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

Finally I made the change to the forge version and the TFC version in the build.props file.

 

 

Can you clarify, the name of the file in your add-on folder is build.prop not build.props?

 

Are you running the setup.bat file within Windows Explorer or Eclipse?

0

Share this post


Link to post
Share on other sites

that seems to have fixed it....I added an "s" to the end of the file name...derp.. -_-

0

Share this post


Link to post
Share on other sites

glad that was all it was, I was stumped otherwise!

 

So everything is good now?

0

Share this post


Link to post
Share on other sites

If anyone want to create new mod on new TFC 79.20 following Bletch instructions. Please do read this. May be it'll save you time.

 

You downloaded 79.20 zip. Do all preps as instruction says. On run debug Eclipse will throw you a windows "Select an mcp config dir for the deobfuscator".

Solution:

Go to your project folder "runClientconfig" i.e.:

C:TFCModdingTFCraft-0.79.20runClientconfig

 

There will be empty file named.

 

CodeChickenLib.cfg

 

I don't know why exactly it's empty.

 

Fill it with this. Don't forget to change disk name and user if required. Then save it and debug TFC project again.

 

#CodeChickenLib development configuration file.

 
dump_asm=true
 
#Path to directory holding packaged.srg, fields.csv and methods.csv for mcp remapping
mappingDir=C:Users<userName>.gradlecachesminecraftnetminecraftforgeforge1.7.10-10.13.4.1448-1.7.10unpackedconf
 
textify=true
Edited by meltafire
1

Share this post


Link to post
Share on other sites

I've gotten to the point where I started trying to add anvil plans and recipes, I'm having a bit of trouble...I think the code itself is right but it isn't being read correctly or something. Does anyone have some example/open source code I could take a look at?

0

Share this post


Link to post
Share on other sites

Thanks for the help Emris that makes a lot more sense than how I was trying to do it. :P

0

Share this post


Link to post
Share on other sites

I'm still having trouble with this and I can't find the error.

 

initialiseAnvil is ran by my mod class during FMLInitializationEvent

public static void initialiseAnvil()

{

// check if the plans/recipes have already been initialized.

if (ModRecipes.areAnvilRecipesInitialised()) return;

 

System.out.println("[" + ModDetails.ModName + "] Registering Anvil Recipes");

 

registerAnvil();

 

System.out.println("[" + ModDetails.ModName + "] Done Registering Anvil Recipes");

}

 

initialiseAnvil calls up registerAnvil.

private static void registerAnvil()

{

AnvilManager anvil = AnvilManager.getInstance();

 

//Plans

anvil.addPlan("Casing", new PlanRecipe(new RuleEnum[] {RuleEnum.HITLAST, RuleEnum.BENDSECONDFROMLAST, RuleEnum.HITTHIRDFROMLAST}));

 

//Recipes

anvil.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.WroughtIronIngot), null, "Casing", AnvilReq.WROUGHTIRON, new ItemStack(ModItems.itemCompassCasing, 1)));

anvil.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.RoseGoldIngot), null, "Casing", AnvilReq.COPPER, new ItemStack(ModItems.itemClockCasing, 1)));

}

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

The initialAnvil should not be called during the initialise but when you log into a world. The template code I provided already has this in place.

Also how do you know it is not working? What is going wrong?

0

Share this post


Link to post
Share on other sites

I didn't see and still don't see how it is being called...

 

As far as my issue when I enter a test world and attempt to craft the item on the anvil using the recipe/plan there is no plan there to select in the anvil.

0

Share this post


Link to post
Share on other sites

There are three places the initialise anvil method is called. I am unable to tell you where at the moment but searching for the method should let you know.

As for the recipes and plan they seem fine to me. Can you check something

Start your mod, debug mode and log into a world. Look for the console output generated by the initialiseAnvil method.

0

Share this post


Link to post
Share on other sites

I don't see where it did anything.

 

I did search for the initialise anvil method and it does come up in the three locations, and I know for sure that I haven't touched those files before.

 

Here is the console output from when I started the world.

[16:32:33] [server thread/INFO]: Starting integrated minecraft server version 1.7.10

[16:32:33] [server thread/INFO]: Generating keypair

[16:32:33] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[16:32:33] [server thread/INFO] [FML]: Applying holder lookups

[16:32:33] [server thread/INFO] [FML]: Holder lookups applied

[16:32:34] [server thread/INFO] [FML]: Loading dimension 0 (test) (net.minecraft.server.integrated.IntegratedServer@67dc8d10)

[16:32:34] [server thread/INFO] [FML]: Loading dimension 1 (test) (net.minecraft.server.integrated.IntegratedServer@67dc8d10)

[16:32:34] [server thread/INFO] [FML]: Loading dimension -1 (test) (net.minecraft.server.integrated.IntegratedServer@67dc8d10)

[16:32:35] [server thread/INFO]: Preparing start region for level 0

[16:32:36] [server thread/INFO]: Preparing spawn area: 14%

[16:32:37] [server thread/INFO]: Preparing spawn area: 73%

[16:32:38] [server thread/INFO]: Changing view distance to 5, from 10

[16:32:39] [Netty Client IO #0/INFO] [FML]: Server protocol version 2

[16:32:39] [Netty IO #1/INFO] [FML]: Client protocol version 2

[16:32:39] [Netty IO #1/INFO] [FML]: Client attempting to join with 9 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]

[16:32:39] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

[16:32:39] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER

[16:32:39] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[16:32:39] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

[16:32:39] [server thread/INFO]: Powerman913717[local:E:df19e683] logged in with entity id 117 at (-61.86892608830776, 144.0, -11830.182473671735)

[16:32:39] [server thread/INFO]: Powerman913717 joined the game

[16:32:40] [server thread/INFO] [Waila]: Player EntityPlayerMP['Powerman913717'/117, l='test', x=-61.87, y=144.00, z=-11830.18] connected. Sending ping

[16:32:42] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4246ms behind, skipping 84 tick(s)

[16:32:55] [Client thread/INFO] [Waila]: Received server authentication msg. Remote sync will be activated

[16:33:04] [server thread/INFO]: Saving and pausing game...

[16:33:04] [server thread/INFO]: Saving chunks for level 'test'/DEFAULT

[16:33:05] [server thread/INFO]: Saving chunks for level 'test'/Nether

[16:33:06] [server thread/INFO]: Saving chunks for level 'test'/DEFAULT

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

I'm working on adding just standard recipes and that's going well except I'm having trouble using some of the TFC items because how how everything is set up how would I go about using small magnetite in a recipe. (I'm mainly confused by the whole metadata thing.)

 

P.S. Still don't have anvil recipes working/the plans aren't loading, I removed the call in the main intial event so that the correct handlers in place would take care of it but it still doesn't load.

0

Share this post


Link to post
Share on other sites

There are two java classes for the ores, they are ItemOre (15, 25 & 35 unit ores) and ItemOreSmall (10 unit ores), they are under the /src/Common/com/bioxx/tfc/Items folder.

 

The meta used for each ore is based on it's position in a metanames array in the class.

MetaNames = new String[]{
"Native Copper", "Native Gold", "Native Platinum", "Hematite", "Native Silver", "Cassiterite", "Galena", "Bismuthinite", "Garnierite", 
"Malachite", "Magnetite", "Limonite", "Sphalerite", "Tetrahedrite", 
"Bituminous Coal", "Lignite", "Kaolinite", "Gypsum", "Satinspar", "Selenite", "Graphite", "Kimberlite", 
/*22*/"Petrified Wood", "Sulfur", "Jet", "Microcline", "Pitchblende", "Cinnabar", "Cryolite", "Saltpeter", "Serpentine", "Sylvite", 
/*32*/"Borax", "Olivine", "Lapis Lazuli", "Rich Native Copper", "Rich Native Gold", "Rich Native Platinum", "Rich Hematite", 
"Rich Native Silver", "Rich Cassiterite", "Rich Galena", "Rich Bismuthinite", "Rich Garnierite", "Rich Malachite", 
"Rich Magnetite", "Rich Limonite", "Rich Sphalerite", "Rich Tetrahedrite", 
"Poor Native Copper", "Poor Native Gold", "Poor Native Platinum", "Poor Hematite", 
"Poor Native Silver", "Poor Cassiterite", "Poor Galena", "Poor Bismuthinite", "Poor Garnierite", "Poor Malachite", 
"Poor Magnetite", "Poor Limonite", "Poor Sphalerite", "Poor Tetrahedrite"};
 
In your case by counting through to find the first instance of Magnetite you would get 10 (arrays are 0 based). At the bottom of the class you will find a method called GetMetalReturnAmount. This is a big case statement of the return metal amounts for each of the ores.
 
Find 10 and it returns TFCOptions.normalOreUnits (25).
Starting at 35 (the first number of the next case section) count the same number down and you get the rich ore meta number. In this case 45 is Magnetite (35 units).
Starting at 49 (the first number of the next case section) count the same number down and you get the poor ore meta number. In this case 59 is Magnetite (15 units).
To get the small ore meta, use the same as the normal, in this case 10.
 
So Magnetite is meta values 10, 45 and 59. 
 
To use them in a recipe you create an ItemStack and the meta number is the third parameter. E.g.
ItemStack smallMagnetite = new ItemStack(TFCItems.SmallOreChunk, 1, 10);   // 10 unit ore
ItemStack poorMagnetite = new ItemStack(TFCItems.OreChunk, 1, 59);    // 15 unit ore
ItemStack normalMagnetite = new ItemStack(TFCItems.OreChunk, 1, 10);     // 25 unit ore
ItemStack richMagnetite = new ItemStack(TFCItems.OreChunk, 1, 45);    // 35 unit ore
 
I hope this help a little.
0

Share this post


Link to post
Share on other sites

Thanks for the help, I had found the class but was unsure of how to use that information.

 

Between you and Emris helping everyone I get most of my questions solve quickly. :P

0

Share this post


Link to post
Share on other sites

Ok new issue, I think the handler that registers/initializes my anvil recipes is having issues on world loading. Any source code out there for anvil handlers that I could take a look at?

 

Working with Bletch on fix.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

I'm trying to use planks in a recipe but I don't need a specific type of wood just any of it but the recipe doesn't work by just leaving the meta data field or whatever blank.

 

GameRegistry.addRecipe(new ItemStack(ModItems.itemPistonBase), new Object[]{"   ","PRP","PPP", 'P', TFCBlocks.Planks, 'R', Items.redstone});

0

Share this post


Link to post
Share on other sites

try this

 

To use Lumber - 

GameRegistry.addRecipe(new ItemStack(ModItems.itemPistonBase), new Object[]{"   ","PRP","PPP", 'P', "woodLumber", 'R', Items.redstone});

 

To use Planks - 

GameRegistry.addRecipe(new ItemStack(ModItems.itemPistonBase), new Object[]{"   ","PRP","PPP", 'P', "plankWood", 'R', Items.redstone});

Edited by Bletch
0

Share this post


Link to post
Share on other sites

Thanks I saw that being used in TFC recipes but I figured that I would need to create my own Item Stack for that to work. 

0

Share this post


Link to post
Share on other sites

these are OreDictionary strings defined by the TFC devs.

 

When you use the strings instead of an item or block, it allows the player to specify any of the items/block defined in the ore dictionary with that key. 

 

Keep in mind that the user can mixes planks types using this method.

 

If you look in the TFC_OreDictionary.java file under the core folder of the TFC code, you will see all the ore dictionary definitions.

0

Share this post


Link to post
Share on other sites

Thanks for the info, you seem to have answers for everything. :)

0

Share this post


Link to post
Share on other sites

just stumbling through, reading TFC and other mod code to work out what is happening and why.

0

Share this post


Link to post
Share on other sites