Creating Custom Structures (Yes, I know it's been asked before)

Discussion in 'Plugin Development' started by nateracecar5, Jan 16, 2015.

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

    nateracecar5

    Okay, so I have a plugin that adds a few "magical tools" and such to the game via custom crafting recipes. Now, in order to find the recipes, you must go find a chest that has been randomly generated in chunks (It does this by testing for chests when a new chunk is generated), and there is a 1 in 3 chance that you will find a book with written instructions on how to craft these tools.

    Now, I'm all into that idea, but I would like to know how to create my own custom structures so that I could control what they look like, how they are made, and how frequent they are, instead of having players try to find dungeons, mine shafts, and the stronghold. How would I do this? I am pretty experienced, but not to the extent of BlockPopulators and ChunkPopulators. If you could, I'm not asking to spoon feed me, but instead explain to me in semi-layman terms that a moderately good plugin developer could understand, and incorporate.

    Thanks for all the help I assume you guys will give me!

    P.S. I am not to keen on using API's because there might be some servers that don't want to download additional plugins, so I want to try to keep it centralized. :)
     
  2. Offline

    Skionz

    @nateracecar5 Extend the BlockPopular class and override the populate method. I believe this method is invoked once per chunk which means you can iterate through every block in the chunk to get each block, or use the second argument (Random instance) to control how often your structures appear. I suggest using schematics.
     
  3. Offline

    nateracecar5

    @Skionz how would I go about using schematics?
     
  4. Offline

    Skionz

  5. Offline

    nateracecar5

    @Skionz Ehh, not to happy about using world edit...
     
  6. Offline

    Skionz

    @nateracecar5 Then I would look into how MCEdit stores schematics.
     
  7. Offline

    nateracecar5

    @Skionz I'm pretty sure it stores it as layers, correct? It takes item id's and stores them as layers, one on top of another. Right?
     
  8. Offline

    Skionz

    I have no idea. I haven't had this issue before as I use WorldEdit.
     
  9. Offline

    nateracecar5

    @Skionz Maybe you could give me an example? Like a github link or something?
     
  10. Offline

    Skionz

Thread Status:
Not open for further replies.

Share This Page