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

I'm requesting guides on how to put together addon mods for TFC for a few reasons:

  • Currently there isn't one place to look and read about addon production and all the information is scattered in different threads.
  • Of the information found in threads there is so many different methods each with their own flaws or problems.

 

I have read most of the material on addons for TFC and I still have trouble with it, different methods for setting up the dev environment often result in different problems that I can never seem to find the answer to.

 

So what  I to know from coders who have made addons is the following:

  • How did you setup your dev environment
  • Where did you begin creating files (In a space created by the setup/did you create a space, if so how did you do that?)
  • Did you have to change your run config to be able to test your addon? (if so how did you set the run config)
  • Did you have to do anything else that I didn't ask for here to be able to create your addon?

Also I have practiced modding in other versions of the game, however I haven't created an addon before.

 

Thanks to anyone who helps me with this endeavor.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

To make an addon, you simply have to add the TFC deobf jar as a module dependency of your project. You get the deobf jar by downloading the zip and running gradlew.bat build from command line, and then grab it from *buildlibs. Adding modules and dependencies differs by development environment. You will also have to grab the src from the same place as the deobf and add it as a library depenancy if you want to view TFC source in an IDE.

0

Share this post


Link to post
Share on other sites

Its late for me here so I'm not going to set this up till the morning; however how do I go about setting the deobf as a module dependency (I'm using eclipse), and for library dependencies I know you put it in a .lib folder but do I need to do anything after that?

 

P.S. Thanks for replying

0

Share this post


Link to post
Share on other sites

I'm requesting guides on how to put together addon mods for TFC for a few reasons:

  • Currently there isn't one place to look and read about addon production and all the information is scattered in different threads.
  • Of the information found in threads there is so many different methods each with their own flaws or problems.

 

I have read most of the material on addons for TFC and I still have trouble with it, different methods for setting up the dev environment often result in different problems that I can never seem to find the answer to.

 

So what  I to know from coders who have made addons is the following:

  • How did you setup your dev environment
  • Where did you begin creating files (In a space created by the setup/did you create a space, if so how did you do that?)
  • Did you have to change your run config to be able to test your addon? (if so how did you set the run config)
  • Did you have to do anything else that I didn't ask for here to be able to create your addon?

Also I have practiced modding in other versions of the game, however I haven't created an addon before.

 

Thanks to anyone who helps me with this endeavor.

 

I would just like to say that it is quite a huge task getting the environment working when you are new to it all. I myself had a lot of problem and received no help at all when asked. The problems I had did not concern TFC but to the lwjgl library.

 

Anyway, I have created a document and a template project that you can use to start your development. I have constructed the document in order for me to setup new add-ons when needed. The template project is empty except some main java classes.

 

Document Link - here

Template Link - here

 

Let me know how you go with it.

5

Share this post


Link to post
Share on other sites

Bletch!

Thank you, I'll try it after work. I could make a test forge mod, but I couldn't link it with TFC yet. It was a long time ago when I used Java.

0

Share this post


Link to post
Share on other sites

Thank you so much, I've been trying to get this stuff working for weeks and haven't been able to. Now I might get something put together!

 

If I get an addon made I'll be sure to put you in the credits somewhere!  :D

0

Share this post


Link to post
Share on other sites

When I run the debug client config I get this message and it asks me to select a folder however when I select one it just asks the same question again and again. (Select an mcp config dir for the deobfuscator)

 

I've went back and double check everything and it appears to be setup the same as your guide says.

 

Edit: I was using the latest 79.20 that was on github being that it hasn't been released here yet, I'm retrying this with 79.19.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

I am looking for a Pinn this thread which has yet to be mentioned in the client / run / mods folder currently has purely NEI and code Chicken Core else can you get a crash .

0

Share this post


Link to post
Share on other sites

I got it working now, I had to start over from scratch and I did everything the same just I used 79.19 instead of 79.20. I don't know if that is what caused if there was an error somewhere else in setting it up.

0

Share this post


Link to post
Share on other sites

I got it working now, I had to start over from scratch and I did everything the same just I used 79.19 instead of 79.20. I don't know if that is what caused if there was an error somewhere else in setting it up.

Worked for me too.

0

Share this post


Link to post
Share on other sites

Ok new problem now...I have changed the name as suggested by the guide to match the name of my addon, however I get a crash when I run it now (TFC Addon Client). I think it has to do with the name change based on what the crash log says. But, I have no errors showing up and I don't know where the problem is.

 

Crash Report

---- Minecraft Crash Report ----

// On the bright side, I bought you a teddy bear!

 

Time: 6/24/15 3:20 PM

Description: There was a severe problem during mod loading that has caused the game to fail

 

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: tfctemplatemod.core.ModClientProxy

at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

Caused by: java.lang.ClassNotFoundException: tfctemplatemod.core.ModClientProxy

at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:58)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59)

... 35 more

Caused by: java.lang.NullPointerException

at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)

... 41 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_79, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 101705000 bytes (96 MB) / 341311488 bytes (325 MB) up to 928514048 bytes (885 MB)

JVM Flags: 0 total; 

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 9 mods loaded, 9 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed

Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed

NotEnoughItems{1.0.4.95} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.4.95-dev.jar) Unloaded->Constructed

tfc_coremod{0.79.19} [TFC[coremod]] (minecraft.jar) Unloaded->Constructed

CodeChickenCore{1.0.4.35} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed

terrafirmacraft{0.79.19} [TerraFirmaCraft] (bin) Unloaded->Constructed

Waila{1.5.11} [Waila] (Waila-1.5.11-RC2-NONEI_1.7.10.jar) Unloaded->Constructed

TFCM{0.1.1} [TerraMisc] (bin) Unloaded->Errored

0

Share this post


Link to post
Share on other sites

Did you rename the ModClientProxy in the template he gave you? If so, you have to make sure to update all references to use the new name. I don't use eclipse, but usually an IDE will have an option to rename the class and automatically update all references to it.

0

Share this post


Link to post
Share on other sites

I made it!!! :lol:

 

 Bletch 

 

 

 

I would just like to say that it is quite a huge task getting the environment working when you are new to it all. I myself had a lot of problem and received no help at all when asked. The problems I had did not concern TFC but to the lwjgl library.

 

Anyway, I have created a document and a template project that you can use to start your development. I have constructed the document in order for me to setup new add-ons when needed. The template project is empty except some main java classes.

 

Document Link - here

Template Link - here

 

Let me know how you go with it.

 

Thank you very much! And can you teach me how exactly did you create "template mod". Yoy know TFC will be updated from time to time. So we in deep need to keep our mods up to date against main TFC mod. TY once more. :rolleyes:

 

 

 

Ok new problem now...I have changed the name as suggested by the guide to match the name of my addon, however I get a crash when I run it now (TFC Addon Client). I think it has to do with the name change based on what the crash log says. But, I have no errors showing up and I don't know where the problem is.

 

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: tfctemplatemod.core.ModClientProxy

 

Good man. I had the same issue. I'm studying the java just about month. But even for me it's very clear where to look at. Just suggestion... But may be you should learn some more about java: packages, debuging, stacktrace? Belive me it's totaly worth it and it will take only couple of weeks. 

Edited by meltafire
0

Share this post


Link to post
Share on other sites

I had already looked into that file and hadn't seen any issues, I spent a semester doing java...but I have a bad habit of skimming through walls of text :P

0

Share this post


Link to post
Share on other sites

I had already looked into that file and hadn't seen any issues, I spent a semester doing java...but I have a bad habit of skimming through walls of text :P

Ok. Just by fat chance.

 

Recheck all params in class.

 

src.main.java.yourmodname.core.ModDetails.java

Edited by meltafire
0

Share this post


Link to post
Share on other sites

I understood that much, I just wanted to make sure no one thought I was an idiot...thanks for helping.

0

Share this post


Link to post
Share on other sites

Sorry guys, just logged on. Have you solved ALL the problems or are you still having trouble?

 

1. 79.20 should have worked, you should be able to download the current code zip and follow the document. I never do this as the dev build is currently changing and hard to keep applying the new changes. I just wait until they do their releases now.

2. I left something important out of the document - Building your add-on. I will add that section and re-upload the document.

3. ModCommonProxy & ModClientProxy are referenced as STRINGS in the main java class. This will NOT cause compile errors but will cause runtime errors. I might add a point to the rename section to get those.

 

Can you make any suggestions for the document?

1

Share this post


Link to post
Share on other sites

I have updated the document to include the proxy issue and have included a section on how to build both TFC and your add-on.

1

Share this post


Link to post
Share on other sites

I have everything working now, thanks for all of your help Bletch! :D

 

Now I just need to go through and figure out the TFC side of things and where the coding differs from base minecraft code...shouldn't be too hard just need to take the time to read through the api files and such.

0

Share this post


Link to post
Share on other sites

 

Thank you very much! And can you teach me how exactly did you create "template mod". 

 

 

I created the template mod after my first add-on. As I mention in the document, it may not be the best way, but it works for me. I have spent quite a lot of time developing my first mod and am about to start another and needed a template to create the new one from. Setting up the main classes was painful the first time, so I just stripped down a copy of my current mod.

 

 

 

Yoy know TFC will be updated from time to time. So we in deep need to keep our mods up to date against main TFC mod. TY once more.  :rolleyes:

 

 

As new versions of TFC are released, just follow the TFC setup in the document to add them to your workspace. Currently in my workspace I have TFC 79.15, 79.17, 79.18 and 79.19.

 

Using the project reference (Configure Add-on Build Settings, page 22 and on) you can change the version of TFC you debug against. Which is great for testing against older versions of TFC.

 

NOTE: If you do this though, always remember to update the DEBOF file in the libs folder of your add-on when building against a different version.

 

I have everything working now, thanks for all of your help Bletch!  :D

 

Now I just need to go through and figure out the TFC side of things and where the coding differs from base minecraft code...shouldn't be too hard just need to take the time to read through the api files and such.

 

Now the hard work starts. The best place to learn is trolling through the TFC code. Find something similar to what you want to build in TFC and study it.

 

Good luck!

Edited by Bletch
1

Share this post


Link to post
Share on other sites

Just a heads up, it looks as though 79.20 is ready to be released. This change also has a forge upgrade. I do not cover this in the document.

Note: After this is done, you may not be able to build this against 79.19.

 

1. Open the build.props file of your add-on.

2. change the following line - 

-forge_version=10.13.2.1291   +forge_version=10.13.4.1448-1.7.10

3. Double-click the setup.bat file. This will start gradle and download the new forge libraries.

 

Note: only do this when 79.20 has been released, you have downloaded the release zip file and setup 79.20 in your workspace using the document.

 

Let me know if you need any help.

0

Share this post


Link to post
Share on other sites

I followed the method in the doc for adding TFC projects in, and added 79.20.

I then changed my debug/run configs to use 79.20, and it runs correctly.

After all of that I changed the build path on my addon to use 79.20 instead of 79.19

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

 

My problem is when I run setup.bat to add in the new forge libraries, but it fails. The error comes up on line 21 of build.gradle and I looked there and didn't see anything that looked like it needed to be changed.

 

Note: I didn't change the DEBOF file in .libs because there is no DEBOF file in my .libs or any other files at all.

0

Share this post


Link to post
Share on other sites

would it be possible to post a screenshot of the dos window when you run setup.bat? I would like to see the error.

 

A question for you, in my previous email on how to update I included this line, -forge_version=10.13.2.1291  +forge_version=10.13.4.1448-1.7.10 did you just update the forge version or copy the whole line? If you copied the whole line, check if it has the + symbol at the start. If so, remove it.

Edited by Bletch
0

Share this post


Link to post
Share on other sites

I just edited the line to use the numbers in green instead of the numbers in red.

 

 

Error:

 

FAILURE: Build failed with an exception.

 

* Where:

Build file 'E:TerraMiscTFCTemplateModbuild.gradle' line: 21

 

* What went wrong:

A problem occurred evaluating root project 'TFCTemplateMod'.

> E:TerraMiscTFCTemplateModbuild.prop (The system cannot find the file specif

ied)

 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug

option to get more log output.

 

BUILD FAILED

 

Total time: 15.64 secs

Press any key to continue . . .

0

Share this post


Link to post
Share on other sites