Posted July 11, 201510 yr I am making a custom world type with a custom generater and it works but i cant seem to get a sphere of air to generate. I ttied using the solution here: http://www.minecraftforge.net/forum/index.php?topic=24403.0 but with no success. It throws and Index of of bounds eception. So my question is how can i get it to generate it. Thanks in advanced.
July 11, 201510 yr Author So im using this for my ore generation code: http://pastebin.com/g1xc4Tj6 And i get this error: http://pastebin.com/xDPB6gSH
July 11, 201510 yr Show where and how you registered your IWorldGenerator Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
July 11, 201510 yr Author I did it here: @EventHandler public void preInit(FMLPreInitializationEvent event) { yourworldtype = new AntLionType("AntLion Farm"); GameRegistry.registerWorldGenerator(caveSphere, 1); }
July 15, 201510 yr You just need to check the chunk bounds while generating, or even just check if the chunk for each given position is loaded, but that's a lot more checks than simply restricting your bounds. Given a set of block coordinates x/y/z, the chunk coordinates are (x >> 4) and (z >> 4), which is equivalent to (x / 16) and (z / 16). That will give you the (0, 0) of your current chunk, but you want block coordinates so multiply it by 16 again to get those. // example int x = 64; int z = 72; int cx = (x >> 4); // gives you 4 int cz = (z >> 4); // also gives you 4 cx = (cx << 4); // gives you 64 cz = (cz << 4); // also gives you 64 // (64, 64) is your zero position for the block coordinates (64, 72) // This iterates over every x position in the chunk: for (int i = cx; i < cx + 16; ++i) { // put z position, etc. } Or, once you've found the zero position, you can also set the max (zero + 16), and the make sure every block position you set is within those bounds. http://i.imgur.com/NdrFdld.png[/img]
July 16, 201510 yr Author I'm a little confused. How does that help me? Im using it as an IWorldGenerator and i don't believe i can use chunk coords there. Can you explain? Also wouldnt this cut off anything going into another chunk completly?
July 17, 201510 yr Author Yes i'm aware that minecraft is generated in chunks my concern was that what ever is getting "cut off" will never be generated at all meaning that a sphere larger han 16/16 will no longer be a sphere. But im still confused... can i have an example?
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.