Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setPuzzle() {
- FileConfiguration con = fm.getConfig(new File(getDataFolder(),"areas.yml")).getFileConfiguration();
- World world = getServer().getWorld("puzzle-1");
- Location from = new Location(world, 14, 99, 17);
- Location to = new Location(world, 46, 116, -17);
- List<Block> b = new ArrayList<>();
- List<Block> r = new ArrayList<>();
- List<Block> y = new ArrayList<>();
- List<Block> g = new ArrayList<>();
- int a = 0;
- int bl = 0;
- int yl = 0;
- int gr = 0;
- while (from.getBlockY() <= to.getBlockY()) {
- int level = from.getBlockY() - 99;
- while(from.getBlockX() <= to.getBlockX()) {
- while (from.getBlockZ() >= to.getBlockZ()) {
- if (from.getBlock().getType() == Material.BLUE_CONCRETE_POWDER) {
- con.set("blue."+level+".blocks."+a+".x",from.getBlockX());
- con.set("blue."+level+".blocks."+a+".y",from.getBlockY());
- con.set("blue."+level+".blocks."+a+".z",from.getBlockZ());
- a++;
- }
- if (from.getBlock().getType() == Material.RED_CONCRETE_POWDER) {
- con.set("red."+level+".blocks."+bl+".x",from.getBlockX());
- con.set("red."+level+".blocks."+bl+".y",from.getBlockY());
- con.set("red."+level+".blocks."+bl+".z",from.getBlockZ());
- bl++;
- }
- if (from.getBlock().getType() == Material.YELLOW_CONCRETE_POWDER) {
- con.set("yellow."+level+".blocks."+yl+".x",from.getBlockX());
- con.set("yellow."+level+".blocks."+yl+".y",from.getBlockY());
- con.set("yellow."+level+".blocks."+yl+".z",from.getBlockZ());
- yl++;
- }
- if (from.getBlock().getType() == Material.GREEN_CONCRETE_POWDER) {
- con.set("green."+level+".blocks."+gr+".x",from.getBlockX());
- con.set("green."+level+".blocks."+gr+".y",from.getBlockY());
- con.set("green."+level+".blocks."+gr+".z",from.getBlockZ());
- gr++;
- }
- a++;
- from.setZ(from.getZ()-1);
- }
- a++;
- from.setX(from.getX()+1);
- }
- a++;
- from.setY(from.getY()+1);
- }
- try {con.save(new File(getDataFolder(),"areas.yml"));} catch (IOException e){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement