Advertisement
Guest User

Untitled

a guest
Jul 28th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  18. for (int px = xMin; px <= xMax; px++) {
  19. for (int py = yMin; py <= yMax; py++) {
  20. for (int pz = zMin; pz <= zMax; pz++) {
  21. if(Equinox.getInstance().getServer().getWorld(Rotation.getRot().getCurrentMap().getWorldName()).getBlockAt(px, py, pz).getType() == m){
  22. return false;
  23. }else{
  24. return true;
  25. }
  26. }
  27. }
  28. }
  29. return false;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement