Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public ArrayList<Location> getWalls(Location loc, double x, double y, double z) {
  2. ArrayList<Location> locs = new ArrayList<>();
  3. for (double ly = -y; ly <= y; ly++) {
  4. for (double lx = -x; lx <= x; lx++) {
  5. for (double lz = -z; lz <= z; lz++) {
  6. if (lx == -x || lx == x || ly == -y || ly == y || lz == -z || lz == z) {
  7. Location newloc = new Location(loc.getWorld(), loc.getX() + lx, loc.getY() + ly,
  8. loc.getZ() + lz);
  9. locs.add(newloc);
  10. }
  11. }
  12. }
  13. }
  14. return locs;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement