Here is the code. I did clean it up so its not as long. Center is the main mod class and if I have the last part where I try to do the @Override it does not work. So I made the second class which to my knowledge does nothing to my understanding as of now. The change to the canPlaceTorchOnTop are at the end of the return statement.
Center
package ThunderMuffin;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
//cropped out for convince
@Mod(modid="ThunderMuffin", name="ThunderMuffin", version="First Muffin")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class Center {
public final static Block goldFence = new BlockFence(3000,"gold_block",Material.rock).setUnlocalizedName("Gold Fence");
//there are a bunch of these
// The instance of your mod that Forge uses.
@Instance("Center")
public static Center instance;
// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="ThunderMuffin.client.ClientProxy", serverSide="ThunderMuffin.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// Stub Method
}
@EventHandler//put recipes in here
public void load(FMLInitializationEvent event) {
proxy.registerRenderers();
GameRegistry.registerBlock(goldFence,"Gold Fence");
LanguageRegistry.addName(goldFence,"Gold Fence");
ItemStack goldFenceStack = new ItemStack(goldFence,6);
GameRegistry.addRecipe(goldFenceStack,"xxx", "xxx",'x',Item.ingotGold);
//there are a bunch of thes
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
// Stub Method
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z)
{
if (world.doesBlockHaveSolidTopSurface(x, y, z))
{
return true;
}
else
{
int id = world.getBlockId(x, y, z);
return id == Block.fence.blockID || id == Block.netherFence.blockID || id == Block.glass.blockID || id == Block.cobblestoneWall.blockID ||(id >2999 && id <3016);
}
}
}
BlockExtender
package ThunderMuffin;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
public class BlockExtender extends Block {
public BlockExtender(int par1, Material par2Material) {
super(par1, par2Material);
// TODO Auto-generated constructor stub
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z)
{
if (world.doesBlockHaveSolidTopSurface(x, y, z))
{
return true;
}
else
{
int id = world.getBlockId(x, y, z);
return id == Block.fence.blockID || id == Block.netherFence.blockID || id == Block.glass.blockID || id == Block.cobblestoneWall.blockID ||(id >2999 && id <3016);
}
}
}