BaseMetals icon indicating copy to clipboard operation
BaseMetals copied to clipboard

Supporting NBT in Custom hammer Recipes (Thanks to RacerDelux of MMD)

Open jriwanek opened this issue 8 years ago • 5 comments

[2:53 PM] RacerDelux: ok so you have to make your own ShapedOreRecipe [2:53 PM] RacerDelux: and implement thse methods [2:53 PM] RacerDelux: public class MPBRecipe extends ShapedOreRecipe{

public MPBRecipe(Block result, Object... recipe){super(result, recipe); } public MPBRecipe(Item result, Object... recipe){ super(result, recipe); } public MPBRecipe(ItemStack result, Object... recipe){ super(result, recipe); }

@Override public ItemStack getCraftingResult(InventoryCrafting craftMatrix) {

[2:53 PM] RacerDelux: thats an example from mine [2:53 PM] RacerDelux: in the getcraftingresult [2:54 PM] RacerDelux: you can get the stack of items that were in the table [2:54 PM] RacerDelux: then you do [2:54 PM] RacerDelux: tmp.setTagCompound(new NBTTagCompound()); tmp.getTagCompound().setString("test", "I am a new item!"); [2:54 PM] RacerDelux: where tmp is a new itemstack [2:55 PM] RacerDelux: and then at the end of getcraftingresult [2:55 PM] RacerDelux: you just return tmp [2:55 PM] RacerDelux: or whatever you call the itemstack

jriwanek avatar Feb 10 '17 09:02 jriwanek

Work in progress to extend the CrusherRecipe class to include NBT support. Might not be as difficult as research first indicated.

dshadowwolf avatar Feb 14 '17 22:02 dshadowwolf

Complications from Java and the old Cyano code have stopped progress for now.

dshadowwolf avatar Feb 16 '17 06:02 dshadowwolf

@dshadowwolf wasn't this what you were working on yesterday? I got the idea you finished it and got it pulled

YaibaToKen avatar Oct 19 '18 14:10 YaibaToKen

Untested - we have no users in the code-base currently, so I'm leaving it open for now

dshadowwolf avatar Oct 19 '18 14:10 dshadowwolf

For a proper JEI interface there is probably some more work needed here

dshadowwolf avatar Oct 20 '18 19:10 dshadowwolf