Create a cuboid region

Discussion in 'Plugin Development' started by FireBreath14, Apr 15, 2013.

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

    FireBreath14

    I'm trying to figure out how to code for a region within two points (kinda like WorldEdit). Its easy to get the 2 point's im looking for, but how to find whats inbetween?

    Thanks for your help!


    P.S. Please don't redirect me to some other thread or "look at so-and-so's source code" no i'd like to get the help HERE. Thanks :)
     
  2. Offline

    Rocoty

    Think three dimensions. And think loops. You have one position, and you have another.

    1. Loop from the lowest x through the highest x.
    2. For every x, loop through every y.
    3. For every y, loop through every z.

    So, essentially a loop within a loop within a loop. And then you can get the block at the position of the current XYZ for every interation. Simple, yes?
     
  3. Offline

    FireBreath14

    whew complicated. thx tho :) ill try
     
Thread Status:
Not open for further replies.

Share This Page