Added toBlockLocation util

This commit is contained in:
Fabrizio La Rosa 2020-08-01 22:41:50 +02:00
parent 57994742a2
commit dd3f89221f

View File

@ -381,4 +381,12 @@ public final class LocationUtil {
centerLoc.setZ((double)loc.getBlockZ() + 0.5D);
return centerLoc;
}
public static Location toBlockLocation(Location loc) {
Location blockLoc = loc.clone();
blockLoc.setX(loc.getBlockX());
blockLoc.setY(loc.getBlockY());
blockLoc.setZ(loc.getBlockZ());
return blockLoc;
}
}