jawsawn
-
Posts
13 -
Joined
-
Last visited
Posts posted by jawsawn
-
-
So how do I get my recipes to result in thermalfoundation items? And how do I use
ForgeRegistries.ITEMS.getValue()
In postinit?
And how do I get the modname and the item name?
-
1 minute ago, diesieben07 said:
You can get any item or block by name by using ForgeRegistries.ITEMS.getValue resp. ForgeRegistries.BLOCKS.getValue.
However with ingots you might want to use the OreDicitionary instead.
I can't for some parts, like a recipe cant result in a oredict.
-
I want to use Thermal Foundation's ingots as a recipe output in my mod. How can I do this?
-
I have gone with the gotItemContainer and has ItemContainer way. And it works
Thanks
-
2 hours ago, diesieben07 said:
If you want to do it for just once recipe you need a custom IRecipe implementation. If you want it to apply whenever the item is used in any recipe, override getContainerItem and hasContainerItem in the item class. getContainerItem will be called to determine the item that should be "left behind" when crafting.
Can you explain more about overriding getContainerItem and hasContainerItem? Do I have to change my recipes with that?
-
14 minutes ago, diesieben07 said:
No idea what you mean.
So I have to add
@Override public boolean hasContainerItem() { return true; }
@Override public ItemStack getContainerItemStack(ItemStack itemStack) { // copy our item. ItemStack returnItem = new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage()+1);
For the item's class and all the other recipes these items been in turns into damaged recipes?
-
1 minute ago, diesieben07 said:
Any decently coded auto-crafting mod will support IRecipe, it's not hard. You might however need to write custom NEI/JEI/whatever handlers if you want the recipe to display there, but this can be mitigated by extending from one of the existing recipe classes and only adding the add-damage functionality.
I don't have code examples for the container item, but it should be pretty straightforward.
Don't I have to boggle with durability decrease math with container item?
-
3 minutes ago, diesieben07 said:
If you want to do it for just once recipe you need a custom IRecipe implementation. If you want it to apply whenever the item is used in any recipe, override getContainerItem and hasContainerItem in the item class. getContainerItem will be called to determine the item that should be "left behind" when crafting.
It does matter when it comes to cross mod compat with autocrafting with IRecipe right? I'm planning to do like only 2 recipes where the item gets upgraded which should remove it. Also can you link me to "getContainerItem and hasContainerItem" example codes? Thanks for your support.
-
2 minutes ago, diesieben07 said:
registerOre can also take an ItemStack.
Wow thanks it worked! Also any tips how can I cause some recipes to lower the tools durability?
-
4 minutes ago, diesieben07 said:
The damage value is part of the ore dict entry. If you want the entry to match all damage values then use WILDCARD_VALUE when registering the entry.
That sounds logical but where would I put it?
OreDictionary.registerOre("stonePhis", ModItems.phis);
-
5 minutes ago, loordgek said:
you need to use ShapelessOreRecipe and for the input you give it the oredict name
That works but it doesn't work with already damaged items.
-
I have a weak modding knowledge and a java noob, but I can work my way out if I get an example.
So I added 3 different items to an oredict and I want to use them in a couple of shapeless crafting recipes. I also want them to take damage upon crafting. How do I achieve that?
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.DIAMOND, 1),new ItemStack("stonePhis", 1 , OreDictionary.WILDCARD_VALUE),"ingotGold","ingotGold","ingotGold","ingotGold"));
This is supposed to take any item from that oredict with any damage value but it expectedly doesn't work because you can't have quotation marks in Itemstack. So how do I get this to work and how do I damage it upon crafting?
[1.10] Using other mod's Items in my recipes
in Modder Support
Posted
Well you guys weren't that helpful, I have figured it out for future references: