Skip to content

Instantly share code, notes, and snippets.

@bdew
Created May 25, 2015 11:08
Show Gist options
  • Save bdew/94fcbea487bf49b7900d to your computer and use it in GitHub Desktop.
Save bdew/94fcbea487bf49b7900d to your computer and use it in GitHub Desktop.
Carbon value registration
NBTTagCompound tag = new NBTTagCompound();
ItemStack item = new ItemStack(Items.diamond);
// This is the item that will be registered
tag.setTag("item", item.writeToNBT(new NBTTagCompound()));
// Carbon value
tag.setInteger("value", 10000);
// Send message
FMLInterModComms.sendMessage("advgenerators", "AddCarbonValue", tag);
NBTTagCompound tag2 = new NBTTagCompound();
ItemStack item2 = new ItemStack(Blocks.cactus);
// Another item
tag2.setTag("item", item2.writeToNBT(new NBTTagCompound()));
// This will use burn time in vanilla furnace as carbon value
tag2.setBoolean("useBurnTime", true);
// Send second message
FMLInterModComms.sendMessage("advgenerators", "AddCarbonValue", tag2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment