SHOW:
|
|
- or go back to the newest paste.
| 1 | public static Boolean contains(Material m, Location corner1, Location corner2){
| |
| 2 | int xMin = 0; | |
| 3 | int xMax = 0; | |
| 4 | int yMin = 0; | |
| 5 | int yMax = 0; | |
| 6 | int zMin = 0; | |
| 7 | int zMax = 0; | |
| 8 | ||
| 9 | xMin = Math.min(corner1.getBlockX(), corner2.getBlockX()); | |
| 10 | xMax = Math.max(corner1.getBlockX(), corner2.getBlockX()); | |
| 11 | ||
| 12 | yMin = Math.min(corner1.getBlockY(), corner2.getBlockY()); | |
| 13 | yMax = Math.max(corner1.getBlockY(), corner2.getBlockY()); | |
| 14 | ||
| 15 | zMin = Math.min(corner1.getBlockZ(), corner2.getBlockZ()); | |
| 16 | zMax = Math.max(corner1.getBlockZ(), corner2.getBlockZ()); | |
| 17 | - | |
| 17 | + | |
| 18 | World world = Equinox.getInstance().getServer().getWorld(Rotation.getRot().getCurrentMap().getWorldName()); | |
| 19 | ||
| 20 | for (int px = xMin; px <= xMax; px++) {
| |
| 21 | - | if(Equinox.getInstance().getServer().getWorld(Rotation.getRot().getCurrentMap().getWorldName()).getBlockAt(px, py, pz).getType() == m){
|
| 21 | + | |
| 22 | - | return false; |
| 22 | + | |
| 23 | - | }else{
|
| 23 | + | if (world.getBlockAt(px, py, pz).getType() == m){
|
| 24 | return true; | |
| 25 | } | |
| 26 | } | |
| 27 | } | |
| 28 | } | |
| 29 | return false; | |
| 30 | } |