Posted April 19, 201510 yr I'm using an IWorldGenerator to generate veins of my custom ores, and it works just fine in the Overworld, but when I use the same code in the Nether it blows up with OutOfMemory errors. Is there anything in particular to be aware of when generating in areas other than the surface?
April 19, 201510 yr Author Here's my WorldGenerator - if you need more let me know: http://pastebin.com/duHqs7jB
April 19, 201510 yr Author I set it to 32 veins per chunk to make sure I could find the ore when mining; that's not the final values. I had no problem running without the nether-generating code with 1GB, but even with 2GB I ran out of heap when I enabled the nether code.
April 20, 201510 yr Author It does work without the code, but for some reason, if it's above 1 on the veins per chunk count, it crashes.
April 21, 201510 yr A chunk is 16x16 blocks, so if you multiply the chunk coordinates by 32 before passing them to your generate[dimensionName] methods, you'll actually be generating very far away from the intended chunks. Consider the following line-by-line walkthrough: At L17 your method has been called; suppose it receives chunk coordinates (2,2). On L21 the method multiplies these values by 32 and pass them to the individual dimension methods. The values are now (64,64). At L56 the method then adds a random integer between 0 and 32 to each of them. Worst case scenario, the values are now (96,96). This is somewhat far away from the coordinates of Chunk (2,2), which should have coordinates between 32 and 48 for the X and Z (I can't recall whether they're positive or negative, sorry). You can imagine how this issue is magnified the farther out from chunk (0,0) you travel - very soon you'll be generating in chunks that are a massive distance away, which is a significant resource demand. If you didn't travel to the Nether from or near chunk coordinates (0,0) you will immediately be generating in distant chunks, which is what causes the memory issue. TL;DR - Change those 32s to 16s, a chunk is 16x16 blocks and not 32x32.
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.