diff options
Diffstat (limited to 'src/main/java/com/MylesAndMore/tumble/api')
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/api/Generator.java | 51 | ||||
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/api/Layers.java | 80 |
2 files changed, 103 insertions, 28 deletions
diff --git a/src/main/java/com/MylesAndMore/tumble/api/Generator.java b/src/main/java/com/MylesAndMore/tumble/api/Generator.java index d66352a..0a35767 100644 --- a/src/main/java/com/MylesAndMore/tumble/api/Generator.java +++ b/src/main/java/com/MylesAndMore/tumble/api/Generator.java @@ -45,6 +45,33 @@ public class Generator { } /** + * Generates a cubiod (literally just a ripoff fill command) + * @param firstPos The first Location to fill (first three coords in a fill command) + * @param secondPos The second Location to fill to (second three coords) + * @param material The Material to fill + */ + public static List<Block> generateCuboid(Location firstPos, Location secondPos, Material material) { + World world = firstPos.getWorld(); + List<Block> blocks = new ArrayList<>(); + int fX = firstPos.getBlockX(); + int fY = firstPos.getBlockY(); + int fZ = firstPos.getBlockZ(); + int sX = secondPos.getBlockX(); + int sY = secondPos.getBlockY(); + int sZ = secondPos.getBlockZ(); + + for (int x = fX; x <= sX; x++) { + for (int y = fY; y <= sY; y++) { + for (int z = fZ; z <= sZ; z++) { + world.getBlockAt(x, y, z).setType(material); + blocks.add(world.getBlockAt(x, y, z)); + } + } + } + return blocks; + } + + /** * Generates clumps in a pre-generated layer. * @param blockList A list of block Locations that this method is allowed to edit * @param materialList A list of Materials for the generator to randomly choose from. @@ -87,28 +114,4 @@ public class Generator { blocks.remove(aBlock); } } - - /** - * Generates a cubiod (literally just a ripoff fill command) - * @param firstPos The first Location to fill (first three coords in a fill command) - * @param secondPos The second Location to fill to (second three coords) - * @param material The Material to fill - */ - public static void generateCuboid(Location firstPos, Location secondPos, Material material) { - World world = firstPos.getWorld(); - int fX = firstPos.getBlockX(); - int fY = firstPos.getBlockY(); - int fZ = firstPos.getBlockZ(); - int sX = secondPos.getBlockX(); - int sY = secondPos.getBlockY(); - int sZ = secondPos.getBlockZ(); - - for (int x = fX; x <= sX; x++) { - for (int y = fY; y <= sY; y++) { - for (int z = fZ; z <= sZ; z++) { - world.getBlockAt(x, y, z).setType(material); - } - } - } - } } diff --git a/src/main/java/com/MylesAndMore/tumble/api/Layers.java b/src/main/java/com/MylesAndMore/tumble/api/Layers.java index fba6fbf..dad5ea8 100644 --- a/src/main/java/com/MylesAndMore/tumble/api/Layers.java +++ b/src/main/java/com/MylesAndMore/tumble/api/Layers.java @@ -23,6 +23,41 @@ public class Layers { matList.add(gen8); matList.add(gen9); matList.add(gen10); + matList.add(gen12); + matList.add(gen14); + matList.add(gen15); + matList.add(gen16); + matList.add(gen0); + matList.add(gen1); + matList.add(gen2); + matList.add(gen3); + matList.add(gen4); + matList.add(gen5); + matList.add(gen6); + matList.add(gen7); + matList.add(gen8); + matList.add(gen9); + matList.add(gen10); + matList.add(gen12); + matList.add(gen14); + matList.add(gen15); + matList.add(gen16); + matList.add(gen0); + matList.add(gen1); + matList.add(gen2); + matList.add(gen3); + matList.add(gen4); + matList.add(gen5); + matList.add(gen6); + matList.add(gen7); + matList.add(gen8); + matList.add(gen9); + matList.add(gen10); + matList.add(gen12); + matList.add(gen14); + matList.add(gen15); + matList.add(gen16); + // Troll glass layer matList.add(gen11); } @@ -97,17 +132,13 @@ public class Layers { private final List<Material> gen3 = new ArrayList<>() {{ add(Material.PACKED_ICE); - add(Material.ICE); add(Material.PACKED_ICE); - add(Material.ICE); add(Material.NOTE_BLOCK); add(Material.TNT); add(Material.LIGHT_BLUE_CONCRETE); add(Material.GLASS); add(Material.PACKED_ICE); - add(Material.ICE); add(Material.PACKED_ICE); - add(Material.ICE); add(Material.NOTE_BLOCK); add(Material.TNT); add(Material.LIGHT_BLUE_CONCRETE); @@ -170,6 +201,7 @@ public class Layers { add(Material.RED_NETHER_BRICKS); add(Material.NETHER_WART_BLOCK); add(Material.CRYING_OBSIDIAN); + add(Material.MAGMA_BLOCK); }}; private final List<Material> gen7 = new ArrayList<>() {{ @@ -266,6 +298,46 @@ public class Layers { add(Material.WHITE_STAINED_GLASS); }}; + private final List<Material> gen12 = new ArrayList<>() {{ + add(Material.DIRT); + add(Material.DIRT_PATH); + add(Material.GRASS_BLOCK); + add(Material.OAK_SLAB); + add(Material.BRICK_WALL); + add(Material.BRICK_STAIRS); + }}; + + private final List<Material> gen14 = new ArrayList<>() {{ + add(Material.LECTERN); + add(Material.OBSIDIAN); + add(Material.SPONGE); + add(Material.BEEHIVE); + add(Material.DRIED_KELP_BLOCK); + }}; + + private final List<Material> gen15 = new ArrayList<>() {{ + add(Material.SANDSTONE); + add(Material.SANDSTONE_SLAB); + add(Material.RED_SANDSTONE); + add(Material.RED_SANDSTONE_SLAB); + add(Material.RED_TERRACOTTA); + add(Material.TERRACOTTA); + add(Material.YELLOW_TERRACOTTA); + }}; + + private final List<Material> gen16 = new ArrayList<>() {{ + add(Material.JUNGLE_LOG); + add(Material.STRIPPED_JUNGLE_LOG); + add(Material.JUNGLE_WOOD); + add(Material.STRIPPED_JUNGLE_WOOD); + add(Material.MOSSY_COBBLESTONE); + add(Material.MOSSY_COBBLESTONE); + add(Material.MOSSY_COBBLESTONE); + add(Material.JUNGLE_LEAVES); + add(Material.JUNGLE_SLAB); + add(Material.JUNGLE_TRAPDOOR); + }}; + private final List<List<Material>> matList = new ArrayList<>(); } |