Jump to content

Out of Memory Error [Solved]


Mrolas

Recommended Posts

Whenever I try to implement one of my blocks, minecraft crashes on world start up.  If I comment out all the registration and initialization for this block, the game runs fine and all my other blocks work.  It's just this one. And I have no idea why :/

 

This is a copy of what was in the console: https://gist.github.com/Mrolas/8157495

And this is all the relevant code: http://pastebin.com/u/Mrolas

 

The block that is somehow causing it is the one called shopStop in the files.

 

Link to comment
Share on other sites

Hi

 

I couldn't navigate your code but it looks to me like you're running out of memory because the vanilla code keeps trying to find a place to spawn the player, but for some reason it can't find anywhere that doesn't collide with one of the blocks.  This is odd because it keeps increasing the y value and normally it should pop out into free space, unless you're in a world with no sky.

Each time it tries, it creates an AABB and if it keeps trying long enough, it runs out of heap space to store them all.

 

Are you doing something strange with your shopStop block boundaries, minX, maxX, that sort of thing?  Or have you replaced all the "air" blocks in your world with something that has a collision box?

 

If it were me, I would add a breakpoint to here

 

EntityPlayerMP constructor::

        while (!par2World.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty())
        {
            this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
        }

and trace through getCollidingBoundingBoxes to see why it always finds a colliding box even though the y position is repeatedly incremented.

 

-TGG

Link to comment
Share on other sites

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.