Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isInLocaton(int playerx,int playery int playerz, int x1, int y1, int z1, int x2, int y2, int z2) {
- int smallx;
- int largex;
- int smally;
- int largey;
- int smallz;
- int largez;
- if (x1 > x2) {
- smallx = x2;
- largex = x1;
- } else {
- smallx = x1;
- largex = x2;
- }
- if (y1 > y2) {
- smally = y2;
- largey = y1;
- } else {
- smally = y1;
- largey = y2;
- }
- if (z1 > z2) {
- smallz = z2;
- largez = z1;
- } else {
- smallz = z1;
- largez = z2;
- }
- if (playerx <= largex && playerx >= smallx && playerz <= largez && playerz >= smallz && playery <= largey && playery >= smally){
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement