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

      Server Move   09/13/18

      I (Dries007) have recently taken over as main developer and server admin. This involved moving servers to reduce cost. It's likely there will be some more downtime in the future but most  things should be sorted by now. This forum is in dire need of replacement as the software is quite old and can't be easily updated. If you wish to discuss or stay updated, join our discord: https://invite.gg/terrafirmacraft. The forum will remain available to read, but will be locked in the future, when a new system is setup. The forum and wiki are now ad free. If you'd like to contribute to keeping it that way, you can do so via paypal or patreon.
Powerman913717

[Request] Addon Devlopment Guide

135 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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now