Custom schematic generation during world generation.

Discussion in 'Plugin Development' started by Gamingfreak101, Mar 27, 2015.

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

    Gamingfreak101

    After much searching, I have not been able to find a tutorial to have custom schematic files generated into the world. So, I would like to find out how to use block populators and schematic files to simply add random houses and such throughout the map! Any help is appreciated, thank you!
     
    Last edited: Mar 27, 2015
  2. Offline

    NathanWolf

    That is a cool idea!

    What do you have so far?

    A BlockPopulator should work well for this- it'll get called after a new chunk has generated, so all of the blocks will be in ready- you can then look for a good place to build a structure.

    For schematic loading+pasting, probably best to tie into WorldEdit's API. I'm not aware of any stand-alone schematic libs, though such a thing would be very nice to have.
     
  3. Offline

    Gamingfreak101

    @NathanWolf

    Nothing yet! I honestly don't know where to start yet, I have a basic idea...But am still very clueless. Also, I planned on using their schematics and the plugin itself, i just don't know where and how to implement my idea.
     
  4. Offline

    NathanWolf

    I would start with the BlockPopulator interface- implement a BlockPopulator, then in onWorldInit install it via
    world.getPopulators().add().

    From there you can do something relatively simple like try to change the center block of each chunk on generation ... one step at a time!

    Once you get that all working, then maybe start to dig into the WorldEdit API for the schematic part.
     
  5. Offline

    Gamingfreak101

    Mind sampling the code in a simple way? Would it be on public void onEnable()? I'm quite confused about the block populator. @NathanWolf
     
  6. Offline

    NathanWolf

  7. Offline

    Gamingfreak101

    @NathanWolf Gotcha! I just don't know how to correctly use the block populator! Any ideas at all? I saw your code and the worldInitiation part, however, from there on it is a blur! :p
     
  8. Offline

    Skionz

    Create a BlockPopulator subclass and override the 'populate' method.
     
  9. Offline

    Gamingfreak101

    I have started to work on this project. I will post an update once I get the first version onto my server!
     
Thread Status:
Not open for further replies.

Share This Page