I have tried doing what you said. In the original TnT block, I find this:
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID)
{
this.func_94391_a(par1World, par2, par3, par4, 1, par5EntityPlayer);
par1World.setBlockToAir(par2, par3, par4);
return true;
}
else
{
return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
}
}
So then in my modded BlockModTnT.java, I've placed the following:
public void onBlockPlaced(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, EntityLiving par6EntityLiving)
{
//this.func_94391_a(par1World, par2, par3, par4, 1, par5EntityPlayer);
//par1World.setBlockToAir(par2, par3, par4);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here5");
EntityTNTPrimed var7 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLiving);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here6");
par1World.spawnEntityInWorld(var7);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here7");
par1World.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here8");
}
public void onBlockAdded(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, EntityLiving par6EntityLiving)
{
super.onBlockAdded(par1World, par2, par3, par4);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here1");
//this.func_94391_a(par1World, par2, par3, par4, 1, par5EntityPlayer);
//par1World.setBlockToAir(par2, par3, par4);
EntityTNTPrimed var7 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLiving);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here2");
par1World.spawnEntityInWorld(var7);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here3");
par1World.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F);
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode:" + "Got here4");
/*if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockToAir(par2, par3, par4);
}*/
}
This is my mod_Tnt.java
package net.minecraft.src;
public class mod_Tnt extends BaseMod
{
public static final Block newTnT = (new BlockModTnT(244)).setHardness(0.0F).setUnlocalizedName("modtnt");
public void load()
{
ModLoader.registerBlock(newTnT);
ModLoader.addName(newTnT, "ModdedTnT");
ModLoader.addRecipe(new ItemStack(newTnT, 64), new Object [] {"###", Character.valueOf('#'), Block.dirt});
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
}
You can tell I've put a bunch of trace statements inside the BlockModTnT, and it doesn't look like any of them show up when I call them so it's almost like the code never even reaches there.
Please help.