Jump to content

Recommended Posts

Posted

So im trying to use the forge configuration, and to me everything looks right, and the client starts up fine, but when i enter a saved game or even a new game the client just goes to the building terrain page but with no writing, and uses 4gb+ ram, and i have to end the process. It doesent give an error code or anything.

 

 

this is my industriouspower.java file:

 

package rulerxx.industriouspower;

 

import net.minecraft.src.Block;

import net.minecraft.src.CreativeTabs;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

import cpw.mods.fml.common.Mod.Instance;

import net.minecraft.src.Item;

import cpw.mods.fml.common.Mod.PostInit;

import cpw.mods.fml.common.Mod.PreInit;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import net.minecraftforge.common.Configuration;

 

@Mod(modid="industriouspower", name="IndustriousPower", version="alpha-1.0.0")

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class industriouspower {

@Instance

public static industriouspower instance;

 

@SidedProxy(clientSide="rulerxx.industriouspower.client.ClientProxy", serverSide="rulerxx.industriouspower.CommonProxy")

public static CommonProxy proxy;

 

public static int oreCopperBlockID;

 

 

//items

private final static Item itemSwordSteel = new itemSwordSteel(5000);

private final static Item itemIngotCopper = new itemIngotCopper(5001);

 

//blocks

public static final Block oreCopper = new oreCopper(oreCopperBlockID, 0);

 

 

        @PreInit

        public void preInit(FMLPreInitializationEvent event) {

                Configuration config = new Configuration(event.getSuggestedConfigurationFile());

 

                config.load();

 

                oreCopperBlockID = config.getOrCreateBlockIdProperty("Block Id for Copper", 200).getInt();

 

                config.save();

        }

 

@Init

public void load(FMLInitializationEvent event) {

LanguageRegistry.addName(itemIngotCopper, "Copper Ingot");

LanguageRegistry.addName(itemSwordSteel, "Steel Sword");

LanguageRegistry.addName(oreCopper, "Copper Ore");

GameRegistry.registerBlock(oreCopper);

}

 

@PostInit

public void postInit(FMLPostInitializationEvent event) {

// Stub Method

}

 

 

 

 

}

Posted

This:

public static final Block oreCopper = new oreCopper(oreCopperBlockID, 0);

Is called before this:

oreCopperBlockID = config.getOrCreateBlockIdProperty("Block Id for Copper", 200).getInt();

So your oreCopperBlockID just has garbage data in it, which will indeed probably mess up minecraft in one way or another.

 

With a config file you have to initiate your blocks and items after you load the config file, so for instance in your init/preinit method, e.g.:

public static Block oreCopper;

@Init
public void load(FMLInitializationEvent event) {
        Configuration config = new Configuration(event.getSuggestedConfigurationFile());
        config.load();
        oreCopper = new oreCopper(config.getOrCreateBlockIdProperty("Block Id for Copper", 200).getInt(), 0);
        config.save();
}

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.