Advertisement
riking

ftfy

Jul 28th, 2013
392
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. World world = Equinox.getInstance().getServer().getWorld(Rotation.getRot().getCurrentMap().getWorldName());
  19.  
  20. for (int px = xMin; px <= xMax; px++) {
  21. for (int py = yMin; py <= yMax; py++) {
  22. for (int pz = zMin; pz <= zMax; pz++) {
  23. if (world.getBlockAt(px, py, pz).getType() == m){
  24. return true;
  25. }
  26. }
  27. }
  28. }
  29. return false;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement