Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Boolean contains(Material m, Location corner1, Location corner2){
- int xMin = 0;
- int xMax = 0;
- int yMin = 0;
- int yMax = 0;
- int zMin = 0;
- int zMax = 0;
- xMin = Math.min(corner1.getBlockX(), corner2.getBlockX());
- xMax = Math.max(corner1.getBlockX(), corner2.getBlockX());
- yMin = Math.min(corner1.getBlockY(), corner2.getBlockY());
- yMax = Math.max(corner1.getBlockY(), corner2.getBlockY());
- zMin = Math.min(corner1.getBlockZ(), corner2.getBlockZ());
- zMax = Math.max(corner1.getBlockZ(), corner2.getBlockZ());
- for (int px = xMin; px <= xMax; px++) {
- for (int py = yMin; py <= yMax; py++) {
- for (int pz = zMin; pz <= zMax; pz++) {
- if(Equinox.getInstance().getServer().getWorld(Rotation.getRot().getCurrentMap().getWorldName()).getBlockAt(px, py, pz).getType() == m){
- return false;
- }else{
- return true;
- }
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement