Posted April 5, 201411 yr 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; }
April 5, 201411 yr Author Ahh was it because there was 2 different declerations of the ID fields one being public static int panelBlockID; and the other being in the preInit int panelBlockID.
April 5, 201411 yr Author How come its assigning values such: panelBlockID = 800 decorGlassID = 4095 clockLampID = 4094 When it should be 200, 201, 202 respectively? Is it because of the dev environment?
April 6, 201411 yr Author ahhh ok I knew of the items being reserved but didn't realize that there were ones reserved for terrain
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.