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

Just a small explanation about the metadata. If you leave it blank, it's only going to use a default value of 0. So for plank blocks, that means it would only be oak because that's the one with metadata 0. If you aren't going to be using the ore dictionary strings, you can also use the OreDictionary.WILDCARD_VALUE in the spot for metadata so it knows to use all variations of that one block/item.

0

Share this post


Link to post
Share on other sites

I had an issue using the ore dictionary strings so I ended up using the wild value and I created an item stack to handle it.

0

Share this post


Link to post
Share on other sites

Oh, I just noticed above why you would be having issues. If you're going to use ore dictionary strings, you have to use either

GameRegistry.addRecipe(new ShapelessOreRecipe(

or

GameRegistry.addRecipe(new ShapedOreRecipe(

Using the strings alone isn't going to do anything unless you tell it that it's an ore dictionary recipe, and not a standard one.

0

Share this post


Link to post
Share on other sites

Oh that explains why TFC was using those...ok well I used an Item stack to handle it so either way it works. :P My newest release is using the lumber item for a recipe.

 

code:

final int WILD = OreDictionary.WILDCARD_VALUE;

 

ItemStack lumber = new ItemStack(TFCItems.SinglePlank, 1, WILD); //Item Stack

 

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

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

Generally speaking, it's always much much better to use ore dictionary entries instead of itemstacks. Not only does it make compatibility with your addon infinitely easier, it also allows you to have a bit more flexibility with the crafting recipes when the block may span multiple blocks due to the limit of 16 variations per block.

 

For example, any recipe that uses plank blocks that you want to include all variations of wood, including acacia, absolutely must use the ore dictionary. If you do the itemstack, you can only use one plank block or the other, but not both. So your recipe may work with all variations of the plank block except for acacia, because acacia is the 17th wood type, and therefore has its own separate block.

0

Share this post


Link to post
Share on other sites

Well in that case I'll go ahead and switch to the ore dictionary method then. Thanks for the info Kitty :D

0

Share this post


Link to post
Share on other sites

Ok so if one was extending the TFC custom bow and they wanted to increase the damage that the extended bow does how would one do that? Of course this is hypothetical for sneaky reasons. :P

 

Also if one wanted to get said bow to render in 3D but for it to be positioned more in the middle of the player hand instead of like that of a sword; how would they do that?

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

I figured out the bow thing so no big deal there now.(Except the render that's still a bit odd)

 

However I'm trying to add in additional tools and weapons and I'm doing it in a similar way to how they are created in TFC's ItemSetup file...my problem is how do I call up the materials without having to try and implement copies of TFC's materials. (Cause that currently seems to cause errors.)

 

I've created a custom weapon file much like the Custom sword file and I'm using that to create the new tools the problem lies in using the TFC materials.

 

I think I figured it out just took more tracking through TFC files to find what I needed.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

Nope I was wrong I'm getting crashes...so Kitty/Anyone else how would one go about adding in new tools and weapons following the method that TFC uses?

 

Update: I rewrote a lot of my item registering code to be more like how TFC handles it just because its neater and cleaner. I know that the issue lies with the weapon items cause when I comment them out of the classes the game runs fine.

 

Currently it crashes while initializing with the weapon registering uncommented out; Now after checking the error that the crash report gives me that line has to do with the material stuff.

 

My weapon class is similar to the ItemCustomSword, but I think the error is with how I'm referencing the material stuff that assigns the damage and durability. 

 

So the Question is how do I reference the material(copper, bronze, etc) stats for the new weapons I'm creating? 

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

Bump...updated issues in above post with more detail and updated info based on the changes and progress I've made.

0

Share this post


Link to post
Share on other sites

Ok I've solved most of my weapon issues...however I'm working on some additional features and I can't find much information on to do what I want to do.

 

So I want to create a delay (or maybe in other cases speed up) the rate at which a player can hit(left click/hit entity) with a weapon. I found a post about it on the minecraft forums but I think it may be outdated and/or the information is hard to understand and follow. I'm only concerned with changing stuff in my own custom weapons stuff from vanilla or TFC.

 

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1431644-forge-sword-attack-speed-attack-limit

0

Share this post


Link to post
Share on other sites

So I want to create a delay (or maybe in other cases speed up) the rate at which a player can hit(left click/hit entity) with a weapon.

 

A somewhat hacky workaround is to just give the players mining fatigue whenever they are holding the item.

0

Share this post


Link to post
Share on other sites

I've tried that was having issues cause of how my items are setup, I would have to do something like creating a class for each item or figure out a way in my custom weapon class. So I guess I'll retry that method. I was also worried about pushing the bounds of what is believable...cause would be kinda odd if one picked up a weapon only to get weird particles flying around them.

0

Share this post


Link to post
Share on other sites

Go look at how Tinker's Construct does it with the cleaver. I know for a fact it does the mining fatigue effect, but I'm pretty sure it doesn't also do the particles.

0

Share this post


Link to post
Share on other sites

Oh...you're a genius Kitty...I completely forgot about the clever in TC...I'll go take a took now and see if I can figure it out.

0

Share this post


Link to post
Share on other sites

I've got it working now, Thanks again Kitty.

0

Share this post


Link to post
Share on other sites

Ok I got another problem and of course cause I decide to do weird things there isn't much info out there about how to do this. 

 

I'm to disable the ability to block with a sword like item, how should I go about doing that?

 

I tried overriding on item right click and returning null but that crashes.

0

Share this post


Link to post
Share on other sites

The return type on that method is ItemStack. Try returning the itemstack you get in the parameters.

0

Share this post


Link to post
Share on other sites

I just tried changing null to is and that seems to have worked, meaning no crash and no block.

Edited by Powerman913717
0

Share this post


Link to post
Share on other sites

Follow up question anyone know of good guides for learning how to do custom item renders? Like controlling how the player holds the item and where the item appears in the hand and other parameters like size.

0

Share this post


Link to post
Share on other sites

I'm trying to make Eclipse project with Gradle on Linux without any settings, and I got an error, it says: 

07:11:35.151 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
07:11:35.152 [ERROR] [org.gradle.BuildExceptionReporter] 
07:11:35.152 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
07:11:35.152 [ERROR] [org.gradle.BuildExceptionReporter] Build file '/home/dcndrew/TFCraft/build.gradle' line: 30
07:11:35.153 [ERROR] [org.gradle.BuildExceptionReporter] 
07:11:35.153 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
07:11:35.154 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'TFCraft'.
07:11:35.154 [ERROR] [org.gradle.BuildExceptionReporter] > Could not generate a proxy class for class net.minecraftforge.gradle.user.patch.UserPatchExtension.
07:11:35.157 [ERROR] [org.gradle.BuildExceptionReporter] 
 
What should I set up before building? Based on the gradlew.bat I don't need any system or java home settings. In the line 30 is " apply plugin: 'forge' ", so do it may need Forge?
 
The whole error part is here:http://pastebin.com/cYWmdRdR
Edited by DcNdrew
0

Share this post


Link to post
Share on other sites

Do you have java installed?

What linux distro do you have?

Is your PC connected to the internet?

How did you execute gradle?

0

Share this post


Link to post
Share on other sites

Of course I have Java installed. Kubuntu 15.04 with Oracle Java 1.7.0_80, I'm connected to the net and the command was 

gradle

and

gradle setupdecompworkspace eclipse

too. Same exception.

0

Share this post


Link to post
Share on other sites

You have both the JRE and the JDK installed, correct?

0

Share this post


Link to post
Share on other sites

You have both the JRE and the JDK installed, correct?

 

I think, Eclipse and NetBeans work like a cham too.

0

Share this post


Link to post
Share on other sites