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

Modded Tools - Implementing Other mods tools as compatible with TFC

2 posts in this topic

I began working on a modpack a few weeks ago using Flaxbeard's, HQM, and TFC to name a few of the mods.  After setting up Ore generation, making changes using minetweaker, and adding utility mods I decided to go through each mods items to verify recipies, identify crashes, and ensure all items function properly.  To my dismay Flaxbeards steam tools failed to function with TFC installed.  Since both TFC and Flaxbeards is under the same license and code is provided on GitHub I did some investigation.

 

To get a "Pickaxe" item to work the changes are pretty simple, implement the ICausesDamage interface and changed the material efficiency, and damage.  

 

To get a "Shovel" like item to work was a bit more of a challege, Shovels & Axes dont extend off of the MC classes of their related siblings, instead they use ItemTerraTool as their parents.  So changing that and implementing the super followed by copying and pasting the block list was required to implement another mods shovel.  

 

...Now for the "Axe"  I implemented the shovel changes using the axe expecting it to work the same way.  Rather than the axe being an axe its a generic item, the logs register the event for being harvested then check an internal list of axes.  If the axe is on the list then the wood is returned, else the wood is placed back in the spot you tried to harvest from (Punching wood).  To get an axe to work now the you must import the modded item into TFC and add it to the list Recipes.Axes during item setup.

 

I cant imagine why the shovel and the axe would be created this way when it would be easier to check in the axe is a member (instance of) an interface (IAxe for example) then allow the harvest.  Im still trying to figure out why tools are programmed the way they are rather than using easier more extensible approaches.

0

Share this post


Link to post
Share on other sites

The short answer is that the code for axes and shovels was written a long time ago, and has barely been updated other than minimum to port between MC versions. Adding compatibility for other mods is a very recent thing for TFC, and was not even remotely a priority in the past.

0

Share this post


Link to post
Share on other sites