package tehnut.xtones.compat;

import net.minecraftforge.fml.common.event.FMLInterModComms;
import tehnut.xtones.ConfigHandler;
import tehnut.xtones.RegistrarXtones;
import tehnut.xtones.Xtones;
import tehnut.xtones.block.BlockXtone;

// ChiselTones makes a return!
public class CompatChisel {

    public static void sendIMC() {
        switch (ConfigHandler.chiselMode) {
            case 0: {
                for (BlockXtone xtone : RegistrarXtones.BLOCKS)
                    FMLInterModComms.sendMessage("chisel", "variation:add", Xtones.ID + "|" + xtone.getRegistryName() + "|0");
                break;
            }
            case 1: {
                for (BlockXtone xtone : RegistrarXtones.BLOCKS)
                    for (int i = 0; i < BlockXtone.XtoneType.values().length; i++)
                        FMLInterModComms.sendMessage("chisel", "variation:add", xtone.getName() + "|" + xtone.getRegistryName() + "|" + i);
                break;
            }
        }
    }
}

@@ -24,16 +24,57 @@
 ompat;%0A%0A
+import net.minecraft.nbt.NBTTagCompound;%0A
 import n
@@ -485,32 +485,34 @@
 arXtones.BLOCKS)
+ %7B
 %0A               
@@ -520,114 +520,285 @@
     
-FMLInterModComms.sendMessage(%22chisel%22, %22variation:add%22, Xtones.ID + %22%7C%22 + xtone.getRegistryName() + %22%7C0%22);
+NBTTagCompound tag = new NBTTagCompound();%0A                    tag.setString(%22group%22, Xtones.ID);%0A                    tag.setString(%22block%22, xtone.getRegistryName().toString());%0A                    FMLInterModComms.sendMessage(%22chisel%22, %22add_variation%22, tag);%0A                %7D
 %0A   
@@ -999,16 +999,18 @@
 th; i++)
+ %7B
 %0A       
@@ -1030,123 +1030,358 @@
     
-FMLInterModComms.sendMessage(%22chisel%22, %22variation:add%22, xtone.getName() + %22%7C%22 + xtone.getRegistryName() + %22%7C%22 + i);
+NBTTagCompound tag = new NBTTagCompound();%0A                        tag.setString(%22group%22, xtone.getName());%0A                        tag.setString(%22block%22, xtone.getRegistryName().toString());%0A                        tag.setInteger(%22meta%22, i);%0A                        FMLInterModComms.sendMessage(%22chisel%22, %22add_variation%22, tag);%0A                    %7D
 %0A   

Update Chisel IMC to new API (#11)