Posted July 16, 20178 yr What is the best way to generate structures bigger than a chunk? Are there tutorials for it? I've looked it up online and I know that WorldGenerator shouldn't be used for things bigger than a chunk, and I've seen that the bigger structures in minecraft like strongholds and the woodland mansion have chunkproviders, but I haven't found any tutorials on those. Edited July 16, 20178 yr by GooberGunter
July 16, 20178 yr Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template. If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks. Developer of Levels and Lost Eclipse
July 16, 20178 yr Yes - instead of having a bunch of setBlockState calls specifying every single block in your structure, you can load your structure from NBT in a very few lines of code. Just call the template method to set the blocks in the world in your WorldGenerator class. Developer of Levels and Lost Eclipse
July 16, 20178 yr 4 hours ago, TheXFactor117 said: you can load your structure from NBT in a very few lines of code And that "structure" can include the air you want as a buffer around and/or above. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
July 19, 20178 yr Author But are there any advantages to generating structures the older way? Edited July 19, 20178 yr by GooberGunter
July 20, 20178 yr On 7/15/2017 at 8:14 PM, TheXFactor117 said: Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template. If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks. Is this method also supported in 1.10.2? If so, can I still have some randomization in structures? New Channel: https://www.youtube.com/theawesomegemily'>https://www.youtube.com/theawesomegemily My Group: https://www.youtube.com/officialpixelgem Old Channel: https://www.youtube.com/theawesomegem
July 20, 20178 yr Yes, I believe structure blocks were added in 1.10. As for randomization, what exactly do you want randomized? One draw back of loading from NBT that I found is you can't change the blocks that are saved in the NBT. I haven't looked into it too much though, so there might be a way. You can use Data Blocks to put on top of chests or other important blocks to load loot tables for example too. Developer of Levels and Lost Eclipse
July 20, 20178 yr Author 10 hours ago, TheXFactor117 said: You can use Data Blocks to put on top of chests or other important blocks to load loot tables for example too. Edit: can you use them for mob spawners? Edited July 20, 20178 yr by GooberGunter
July 21, 20178 yr Author How do you load the nbt data in the mod, what class do you extend for the Structure class
July 21, 20178 yr You don't need a structure class. Create a Template variable which loads your NBT file through a ResourceLocation. Once you have a template, just call addBlocksToWorld or whatever the method is called. Developer of Levels and Lost Eclipse
July 21, 20178 yr Author Oh cool, this makes life much easier. I wonder if there's a way to mod the structure block to overwrite the 32 block limit
July 21, 20178 yr It's there for a reason - it's just as easy to spawn multiple structures in next to each other too. Developer of Levels and Lost Eclipse
July 21, 20178 yr Author That's true. I never once thought that there wouldn't be a risk. Do do you know how to set up monster spawners with the structure block?
July 21, 20178 yr When saving your structure, place a monster spawner (the default one) and place a data block on top of it and name it like monster_spawner or something. When you add the blocks to the world, you can call a method which will handle the data blocks. Here is my method for handling data blocks for an example. Essentially you just need to loop through all data blocks in the structure - if the data block name matches the one you are looking for, you can do stuff with the block underneath. For example in my structures, I'm setting the loot table for the chest. For monster spawners, you can get an instance of the Tile Entity and modify it there. After you are done modifying it, simply set the data block to an air block or whatever block you want (or else it'll spawn a random block based on where it is located). Developer of Levels and Lost Eclipse
August 3, 20187 yr On 7/16/2017 at 2:14 AM, TheXFactor117 said: Use Structure Blocks. You can look at Igloos and newer Minecraft structures for example. Basically, all you need to do is build your structure, save it to NBT using Structure Blocks, and load it in through a Template. If you want a structure bigger than 32x32, you can make multiple Structure Blocks and when you spawn the structure in you can the multiple files in and just offset positions depending on the piece. I have some code on my GitHub as well using Structure Blocks. Hey TheXFactor, did you move the code to somewhere else? I wanted to look at some code examples with multiple structure blocks in only one structure but the link that you posted is no longer available. Do you know other tutorials/code that can help me?
August 3, 20187 yr 10 minutes ago, JDL said: Hey TheXFactor, did you move the code to somewhere else? I wanted to look at some code examples with multiple structure blocks in only one structure but the link that you posted is no longer available. Do you know other tutorials/code that can help me? He still has some old tutorials posted on GitHub: https://github.com/doctorhealt3/TheXFactor117s-Forge-Tutorials/blob/master/OldTutorials.md but I can't find anything relevant to this topic. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 3, 20187 yr Just now, jabelar said: He still has some old tutorials posted on GitHub: https://github.com/doctorhealt3/TheXFactor117s-Forge-Tutorials/blob/master/OldTutorials.md but I can't find anything relevant to this topic. Ok, no problem Thanks!
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.