BaseMetals
BaseMetals copied to clipboard
Supporting NBT in Custom hammer Recipes (Thanks to RacerDelux of MMD)
[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
Work in progress to extend the CrusherRecipe class to include NBT support. Might not be as difficult as research first indicated.
Complications from Java and the old Cyano code have stopped progress for now.
@dshadowwolf wasn't this what you were working on yesterday? I got the idea you finished it and got it pulled
Untested - we have no users in the code-base currently, so I'm leaving it open for now
For a proper JEI interface there is probably some more work needed here