Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public boolean isInLocaton(int playerx,int playery int playerz, int x1, int y1, int z1, int x2, int y2, int z2) {
  2. int smallx;
  3. int largex;
  4. int smally;
  5. int largey;
  6. int smallz;
  7. int largez;
  8. if (x1 > x2) {
  9. smallx = x2;
  10. largex = x1;
  11. } else {
  12. smallx = x1;
  13. largex = x2;
  14. }
  15. if (y1 > y2) {
  16. smally = y2;
  17. largey = y1;
  18. } else {
  19. smally = y1;
  20. largey = y2;
  21. }
  22. if (z1 > z2) {
  23. smallz = z2;
  24. largez = z1;
  25. } else {
  26. smallz = z1;
  27. largez = z2;
  28. }
  29. if (playerx <= largex && playerx >= smallx && playerz <= largez && playerz >= smallz && playery <= largey && playery >= smally){
  30. return true;
  31. }
  32. return false;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement