Jump to content

Recommended Posts

Posted

I understand that 1.7 gets rid of the need for ID's, but this is being targeted towards people that still on 1.6.4. I just finished going over the tutorial on the forums here and when I go to run it I always get slot 0 is already occupied when trying to add the second block.

 

The code:

 

@Mod(modid="decor", name="Decor", version="0.0.1 - Dev")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class Decor{

        // The instance of your mod that Forge uses.
        @Instance("decor")
        public static Decor instance;
       
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide="bdvl.decor.client.ClientProxy", serverSide="bdvl.decor.CommonProxy")
        public static CommonProxy proxy;
       
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
                Configuration config = new Configuration(event.getSuggestedConfigurationFile());
                
                config.load();
                int panelBlockID = config.getBlock("Panel", 200).getInt();
                int decorGlassID = config.getBlock("DecorGlass", 201).getInt();
                int clockLampID = config.getBlock("ClockLamp", 202).getInt();
                
                config.save();
        }
       
        @EventHandler
        public void load(FMLInitializationEvent event) {
                proxy.registerRenderers();

			panel = new Panel(panelBlockID, Material.cloth).setHardness(3.0F).setUnlocalizedName("Panel").setCreativeTab(CreativeTabs.tabBlock).setTextureName("decor:panel");
                decorGlass = new decorGlass(decorGlassID, Material.glass, false).setUnlocalizedName("decorglass").setCreativeTab(CreativeTabs.tabBlock);
                clocklamp = new ClockLamp(clockLampID, Material.glass).setUnlocalizedName("clocklamp").setCreativeTab(CreativeTabs.tabDecorations).setTextureName("decor:clocklamp");
                
                GameRegistry.registerBlock(decorGlass, "decorglass");
                GameRegistry.registerBlock(panel, "panel");
                GameRegistry.registerBlock(clocklamp, "clocklamp");
                
                LanguageRegistry.addName(decorGlass, "Decorative Glass");
                LanguageRegistry.addName(panel, "Panel");
                LanguageRegistry.addName(clocklamp, "Clock Lamp");
                
        }
       
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
        public static int panelBlockID;
        public static int decorGlassID;
        public static int clockLampID;
        
        public static Block panel;
        public static Block decorGlass;
        public static Block clocklamp;
       
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.