drok0920 Posted July 11, 2015 Posted July 11, 2015 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. Quote
drok0920 Posted July 11, 2015 Author Posted July 11, 2015 So how you generate ores? Ok that will also work for structures right? Quote
drok0920 Posted July 11, 2015 Author Posted July 11, 2015 So im using this for my ore generation code: http://pastebin.com/g1xc4Tj6 And i get this error: http://pastebin.com/xDPB6gSH Quote
larsgerrits Posted July 11, 2015 Posted July 11, 2015 Show where and how you registered your IWorldGenerator Quote 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/
drok0920 Posted July 11, 2015 Author Posted July 11, 2015 I did it here: @EventHandler public void preInit(FMLPreInitializationEvent event) { yourworldtype = new AntLionType("AntLion Farm"); GameRegistry.registerWorldGenerator(caveSphere, 1); } Quote
drok0920 Posted July 11, 2015 Author Posted July 11, 2015 And it still doesnt work: http://pastebin.com/MJbkXeNk Quote
drok0920 Posted July 12, 2015 Author Posted July 12, 2015 I meant could i have an example, i'm not great with worldgen. Quote
drok0920 Posted July 15, 2015 Author Posted July 15, 2015 Please??? The majority of my mod is the spheres of air. Quote
coolAlias Posted July 15, 2015 Posted July 15, 2015 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. Quote http://i.imgur.com/NdrFdld.png[/img]
drok0920 Posted July 16, 2015 Author Posted July 16, 2015 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? Quote
drok0920 Posted July 17, 2015 Author Posted July 17, 2015 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? Quote
Recommended Posts
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.