Hmmm this is pretty tricky isn't it? I have typed in the second example and it does not want to run at all.
package com.wuppy.samsmod;
import net.minecraft.init.Blocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@Mod(modid = SamsMod.MODID, version = SamsMod.VERSION)
public class SamsMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
}
It does not seem to like the import cpw commands, the @Mod line and the @EventHandler and the public void init line immediately after it.
I get the feeling that either the book is outdated or Forge has not loaded all the resources.