mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-14 19:41:24 +01:00
Merge branch 'development'
This commit is contained in:
commit
0936798178
@ -4,7 +4,7 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
name: "SongodaCore"
|
name: "SongodaCore"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "2.3.33"
|
version: "2.3.34"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -8,4 +8,18 @@ public class LocationUtils {
|
|||||||
return location1.getBlockX() == location2.getBlockX() && location1.getBlockY() == location2.getBlockY() && location1.getBlockZ() == location2.getBlockZ();
|
return location1.getBlockX() == location2.getBlockX() && location1.getBlockY() == location2.getBlockY() && location1.getBlockZ() == location2.getBlockZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isInArea(Location l, Location pos1, Location pos2){
|
||||||
|
double x1 = Math.min(pos1.getX(), pos2.getX());
|
||||||
|
double y1 = Math.min(pos1.getY(), pos2.getY());
|
||||||
|
double z1 = Math.min(pos1.getZ(), pos2.getZ());
|
||||||
|
|
||||||
|
double x2 = Math.max(pos1.getX(), pos2.getX());
|
||||||
|
double y2 = Math.max(pos1.getY(), pos2.getY());
|
||||||
|
double z2 = Math.max(pos1.getZ(), pos2.getZ());
|
||||||
|
|
||||||
|
return l.getX() >= x1 && l.getX() <= x2 &&
|
||||||
|
l.getY() >= y1 && l.getY() <= y2 &&
|
||||||
|
l.getZ() >= z1 && l.getZ() <= z2;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user