Jump to content

Recommended Posts

Posted

try to create you items before the config

Package = new BlockPackage(PackageBlockID, Material.wood).setUnlocalizedName("Package");
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
        config.load();
        //Block
        int PackageBlockID = config.getBlock("Package", 4095).getInt();
        config.save();

 

Posted
  On 4/2/2014 at 11:20 AM, Ghifari160 said:

I already create class file for every items and blocks. They each have seperate class file

 

No, he's saying that you need to load the configuration file, then register the items. You're doing it the other way around.

if (user.hasKnowledgeOfJava) {

    if (user.question.hasCode) {

        return interpetHelpfulResponse(user.getQuestion());

    } else {

        return "Could you post your code please?";

    }

} else {

    return "Learn some freaking Java!";

}

Posted
  On 4/2/2014 at 1:09 PM, diesieben07 said:

  Quote

I already create class file for every items and blocks. They each have seperate class file

You apparently have no idea what I mean.

Pretty much. As I say, I'm new to minecraft modding.

 

 

Posted
  On 4/2/2014 at 3:53 PM, DiabolusNeil said:

  Quote

I already create class file for every items and blocks. They each have seperate class file

 

No, he's saying that you need to load the configuration file, then register the items. You're doing it the other way around.

Apparently this line is killing me:

public static Block GlassTable = new TileEntityGlassTableBlock(GlassTableBlockID).setUnlocalizedName("GlassTable");

So I put comment tag at the begining of the line.

 

EDIT: This is my updated code:

 

  Reveal hidden contents

 

And this is waith I got on the console:

 

  Reveal hidden contents

 

Posted

It's crashing because your Items / Blocks are static, and you are initializing them statically (i.e. outside of a method), so they try to initialize before your config file loads. Put them inside of a method like so:

public static Block glassTable; // changed 'G' to lowercase to match Java naming conventions

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// all your config stuff first

// now all your blocks and items:
glassTable = new TileEntityGlassTableBlock(GlassTableBlockID).setUnlocalizedName("GlassTable");
}

Posted
  On 4/2/2014 at 1:09 PM, diesieben07 said:

  Quote

I already create class file for every items and blocks. They each have seperate class file

You apparently have no idea what I mean.

That line really made me laugh :D

 

 

Hello and welcome to the forge forums Ghifari!

 

Thats just my personal opinion, but why do you even start to develop a new mod for 1.6?

I know, 1.7 isn't finished yet, but the important parts work fine (as long as you don't try to add a dimension or a biome... ::)) and you only have to change a few things (e.g.: IconRegister -> IIconRegister) to update your mod.

Also you no longer nned ids for blocks/items so there is no need for a config file and all these scary id-integers.

Here could be your advertisement!

Posted
  On 4/4/2014 at 2:36 PM, Jacky2611 said:

  Quote

  Quote

I already create class file for every items and blocks. They each have seperate class file

You apparently have no idea what I mean.

That line really made me laugh :D

 

 

Hello and welcome to the forge forums Ghifari!

 

Thats just my personal opinion, but why do you even start to develop a new mod for 1.6?

I know, 1.7 isn't finished yet, but the important parts work fine (as long as you don't try to add a dimension or a biome... ::)) and you only have to change a few things (e.g.: IconRegister -> IIconRegister) to update your mod.

Also you no longer nned ids for blocks/items so there is no need for a config file and all these scary id-integers.

 

It's because I need to make my own mod for my own custom modpack which is still at 1.6.4.

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.