1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved World Generation--Need help

Discussion in 'Development' started by RedCraftPM, Oct 21, 2018.

  1. RedCraftPM

    RedCraftPM Spider

    Messages:
    8
    GitHub:
    redcraftgh
    I am trying to create a custom world generation plugin, and currently the generation for worlds is working. However, I am trying to create a specific world generator which is a flat world, but at 16 chunk intervals there is a random structure. The structures also work. I have no idea how I could make a structure appear every 16 chunks though.
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    "work"??
    you could do it like every X chunk there MUST be a structure
    or like every time before spawning a structure make sure there's none in X chunks near

    you probably need to reference how PC did their generations and somehow port that to PMMP
    sorry i have no clue how and neither most people either
     
  3. RedCraftPM

    RedCraftPM Spider

    Messages:
    8
    GitHub:
    redcraftgh
    I figured out what I need. I completely forgot about the % operator :O

    All I needed to do was check if chunkx % 16 === 0 and chunkz % 16 === 0 which would create a recursive pattern so each structure would generate exactly 16 chunks apart.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.