Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void generateMountain(int startX, int startZ) {
- Material[] layers = new Material[]{Material.STONE, Material.STONE, Material.GRASS};
- boolean[][][] mountain = new boolean[][][]{
- {
- {true, true, true},
- {true, true, true},
- {false, true, false}
- }, {
- {false, true, false},
- {false, true, true},
- {false, false, false}
- }, {
- {false, false, false},
- {false, true, false},
- {false, false, false}
- }
- };
- for (int x = 0; x < 3; x++) {
- for (int z = 0; z < 3; z++) {
- for (int y = 0; y < 3; y++) {
- world.getBlockAt(startX + x, 64 + y, startZ + z).setType(layers[y]);
- }
- for (int y = 3; y < 6; y++) {
- world.getBlockAt(startX + x, 64 + y, startZ + z).setType(mountain[x][y-3][z]?Material.STONE : Material.AIR);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment