Jump to content

[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block


Recommended Posts

Posted

This is starting to get really annoying. I'm working on my mod which adds custom blocks, and after launching the game for about the 100th time, every time I try and enter a world (new or old) I keep getting this error message.

 

 

  Reveal hidden contents

 

 

The error message ends after that. I'm just trying to do a normal GameRegistery.registerBlock(), I'm using a Mac OSX 1.6.8, Eclipse SDK with Java 6 for the decompiler, and Forge 9.11.1.965. Commenting out the register method ends up in Minecraft launching just fine. If you need me to post the code, I will do so.

 

I actually did a coding timelapse a few hours before I had this issue arise. I will post it so you can see that I wasn't having this problem earlier: http://www.youtube.com/watch?v=35FQ9a_QADA

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

[me=Draco18s]sees no code.  Shrugs and leaves.[/me]

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Okay then. Here's the code registering the blocks, which is being called in the mod class.

 

 

  Reveal hidden contents

 

 

The code inside BlockCompoundOre.

 

 

  Reveal hidden contents

 

 

Code from BlockIronCoalOre

 

 

  Reveal hidden contents

 

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

Ok so I see multiple problems here first don't extend blockcompoundores in your block file just instead extend block and in your block compound ore don't extend anything. As your not trying to make blockcompoundore a block I assume just a subsection for all your ores. Then you don't need all the blocks you register in the blockcompoundores to be public static blockcompoundores instead do public static block and it should work.

Posted

I already stated that I was doing the old method earlier, and didn't have any problems. Now when I try and do the exact same thing that I was doing hours ago, I get that error. Look at the coding timelapse, you'll see.

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

I did call the code. It just randomly stopped working. I'll explain a bit more: I was registering blocks, same as always, it was working perfectly fine. I added two more blocks, I then started to get the error. I then commented out the lines of code where I registered the two new blocks. Same thing happens. It might be my system. I'll test later.

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

I'm facedesking myself right now. I didn't have a proper ID for the Gold-Emerald ore. Now everything works. Everyone makes mistakes, I guess.

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!";

}

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.