World Generation Help

Discussion in 'Programming' started by RichStark, Jul 29, 2020.

  1. I need some help on making a plot world. I've been looking into code of some open source projects such as PlotMe, but I can't figure how does it works. Why is he calculating

    Code (Java):
    (valz - n2 + mod1) % size == 0
    What is the base, it would be great if someone can explain me this.
    https://github.com/ZachBora/PlotMe

    Thanks.
     
  2. Ugh ugly code...
    I can only make a vague guess here, the variable names are... not very descriptive. valz (resp. All other vals) seem to be the actual world-coordinats. So the calculation
    Code (Java):
    (valz - n2 + mod1) % size == 0
    Would check if the left-most value (the z-coordinate minus the middle) of a cuboid region is the multiple of a certain size (if that makes sense). Essentially, it checks if a certain location is on the border of the plot.
    The mod1-variable is used since the location if blocks is where their smallest x, y and z- value is, not in the middle of them. So you might have to add +1/-1 to the coordinates