Generate custom structure?

Discussion in 'Plugin Development' started by Symphonic, Mar 1, 2020.

Thread Status:
Not open for further replies.
  1. Offline


    I was looking to make a plugin to make a custom dungeon-like structure.. I have a few questions about how to do it.

    1. I know that placing blocks in the world is very laggy, is there a better way to do it with chunk generation or something?

    2. the structure is going to be in its own world (just void on the outside I guess) so that might make it easier to do it alongside some sort of world generation?

    3. how would I go about making sure all the rooms and halls connect up?
  2. Offline

    Machine Maker

    Yes, so you can absolutely write your own generators for worlds. I haven't delved into it more than just to create void worlds, but its def possible.
  3. Offline


    Did you want it in an empty world? Use a custom ChunkGenerator and use SimplexOctaveGenerator to generate noise given an (x,y). Maybe each chunk could be it's own section of a dungeon. You could determine the section type by passing the chunk x, chunk z into the noise generator.
  4. Offline


    I recently struggled with the exact same problem when trying to paste large schematics in.
    You can use a custom ChunkGenerator, but I fiddled with it for a very long time and could not get it to exactly work right. However what did work for me, was pasting the schematic by layers at a time.
    I'm assuming you're using a schematic, but this premise can be applied to really any other structure storage type.

    All I did was paste each Y layer of the schematic at a time, 2 seconds apart. If you're structure is VERY large, you would probably want to increase the time gap between each layer by a few seconds. If you still experience lag/crashes, you could trim it down even more and do one Y layer, one chunk at a time with only maybe a 200 millisecond gap or so. Just play with the numbers until it feels right.
    If you need some guidance on how to do this, I can help but it is relatively simple. Best of luck.
  5. Offline


    hmm, I was more worried about how i was going to randomly generate it then I was pasting it; everyone will be in the lobby when this is happening so it doesnt need to be too optimized.
Thread Status:
Not open for further replies.

Share This Page