Posted June 9, 201312 yr Is their a way i can make an item that gets damaged in crafting get repaired via crafting? Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
June 9, 201312 yr ...Um, yes. Use a damaged ItemStack as the output. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 10, 201312 yr Author ...Um, yes. Use a damaged ItemStack as the output. That just clones the item. Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
June 10, 201312 yr As in, set the damage (metadata) to 0. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 10, 201312 yr Author As in, set the damage (metadata) to 0. 1.this would still clone it 2.i don't want it to be 100%, if i did i would use the anvil Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
June 10, 201312 yr As in, set the damage (metadata) to 0. 1.this would still clone it 2.i don't want it to be 100%, if i did i would use the anvil Aw, for the love of Pete. Just show me your code. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 10, 201312 yr Author As in, set the damage (metadata) to 0. 1.this would still clone it 2.i don't want it to be 100%, if i did i would use the anvil Aw, for the love of Pete. Just show me your code. Maybe I didn't explain well enough: I have an item. When you use it in a crafting recipe it remains and simply takes damage(Like the minium stone from EE3). I want the item to have a recipe that repairs the item instead of damaging it. Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
June 10, 201312 yr Oh, that kind of item. *facepalm* If you'd said "RP2 chisel", I'd have known exactly what you meant. So it looks like you'll have to define a custom class that inherits IRecipe. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 10, 201312 yr Author What do i do within the class? (also here is my crafting manager if i can just use this file) package dudesmods.lozmod; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.ICraftingHandler; public class LOZCraftingHandler implements ICraftingHandler { public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) { for(int i=0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i) != null) { ItemStack j = inv.getStackInSlot(i); if(j.getItem() != null && j.getItem() == LOZmod.magicPowder) { ItemStack k = new ItemStack(LOZmod.magicPowder, 2, (j.getItemDamage() + 1)); inv.setInventorySlotContents(i, k); } } } } @Override public void onSmelting(EntityPlayer player, ItemStack item) { // TODO Auto-generated method stub } } Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
June 10, 201312 yr What do i do within the class? (also here is my crafting manager if i can just use this file) package dudesmods.lozmod; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.ICraftingHandler; public class LOZCraftingHandler implements ICraftingHandler { public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) { for(int i=0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i) != null) { ItemStack j = inv.getStackInSlot(i); if(j.getItem() != null && j.getItem() == LOZmod.magicPowder) { ItemStack k = new ItemStack(LOZmod.magicPowder, 2, (j.getItemDamage() + 1)); inv.setInventorySlotContents(i, k); } } } } @Override public void onSmelting(EntityPlayer player, ItemStack item) { // TODO Auto-generated method stub } } Oh, that looks like it should work. Although I would just use j.setItemDamage(j.getItemDamage()+1) instead of creating a new ItemStack. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.