diff options
Diffstat (limited to 'src/main/java/com/MylesAndMore/tumble/api')
| -rw-r--r-- | src/main/java/com/MylesAndMore/tumble/api/Generator.java | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/MylesAndMore/tumble/api/Generator.java b/src/main/java/com/MylesAndMore/tumble/api/Generator.java index 99850e9..632627d 100644 --- a/src/main/java/com/MylesAndMore/tumble/api/Generator.java +++ b/src/main/java/com/MylesAndMore/tumble/api/Generator.java @@ -5,7 +5,7 @@ import org.bukkit.Material;  import org.bukkit.World;  public class Generator { -    public static void generateLayer(Location center, int radius, Material material) { +    public static void generateLayer(Location center, int radius, int height, Material material) {          int Cx = center.getBlockX();          int Cy = center.getBlockY();          int Cz = center.getBlockZ(); @@ -13,11 +13,13 @@ public class Generator {          int rSq = radius * radius; -        for (int x = Cx - radius; x <= Cx + radius; x++) { -            for (int z = Cz - radius; z <= Cz + radius; z++) { -                if ((Cx - x) * (Cx - x) + (Cz - z) * (Cz - z) <= rSq) { -                    Location block = new Location(world, x, Cy, z); -                    world.getBlockAt(x, Cy, z).setType(material); +        for (int y = Cy; y < Cy + height; y++) { +            for (int x = Cx - radius; x <= Cx + radius; x++) { +                for (int z = Cz - radius; z <= Cz + radius; z++) { +                    if ((Cx - x) * (Cx - x) + (Cz - z) * (Cz - z) <= rSq) { +                        Location block = new Location(world, x, y, z); +                        world.getBlockAt(x, y, z).setType(material); +                    }                  }              }          }  | 
