CovertJaguar/Railcraft — pull request #370 by ganymedes01 (2014-10-31 17:29:15+00:00)
Title: Rock crusher can receive recipes via IMC

Not sure if it's up to your standards but I decided t give it a try :)

I made this helper method that automatically encodes all the data into a NBT tag and sends it. Thought it would be useful in case you want to include it somewhere to help people figure out how to use the message properly.

```JAVA
public void addRockCrusherRecipe(ItemStack input, boolean matchMeta, boolean matchNBT, Map outputs) {
NBTTagCompound nbt = new NBTTagCompound();

NBTTagCompound inputNBT = new NBTTagCompound();
input.writeToNBT(inputNBT);
nbt.setTag("input", inputNBT);

nbt.setBoolean("matchMeta", matchMeta);
nbt.setBoolean("matchNBT", matchNBT);

int outCount = 0;
for (Entry output : outputs.entrySet()) {
NBTTagCompound outputNBT = new NBTTagCompound();
output.getKey().writeToNBT(outputNBT);
outputNBT.setFloat("chance", output.getValue());
nbt.setTag("output" + outCount++, outputNBT);
}

FMLInterModComms.sendMessage("Railcraft", "rock-crusher", nbt);
}
```