pandalib-util javadoc and small API changes

This commit is contained in:
2022-07-28 01:13:35 +02:00
parent 5ff9a40f19
commit f7dc774dbd
27 changed files with 1585 additions and 1841 deletions

View File

@@ -88,9 +88,9 @@ public class AABBBlock implements Iterable<BlockVector> {
}
public Vector getRandomPosition() {
double x = RandomUtil.nextDoubleBetween(pos1.getX(), pos2.getX());
double y = RandomUtil.nextDoubleBetween(pos1.getY(), pos2.getY());
double z = RandomUtil.nextDoubleBetween(pos1.getZ(), pos2.getZ());
double x = RandomUtil.rand.nextDouble(pos1.getX(), pos2.getX());
double y = RandomUtil.rand.nextDouble(pos1.getY(), pos2.getY());
double z = RandomUtil.rand.nextDouble(pos1.getZ(), pos2.getZ());
return new Vector(x, y, z);
}

View File

@@ -73,7 +73,7 @@ public class GameWorldUtils implements Listener {
if (!new File(Bukkit.getWorldContainer(), world).isDirectory())
throw new IllegalStateException("GameWorld '"+world+"' does not exist");
String copiedName = world + "_gen" + RandomUtil.nextIntBetween(100000, 999999);
String copiedName = world + "_gen" + RandomUtil.rand.nextInt(100000, 999999);
File srcDir = new File(Bukkit.getWorldContainer(), world);
File destDir = new File(Bukkit.getWorldContainer(), copiedName);

View File

@@ -65,9 +65,9 @@ public class LocationUtil {
// generate a random (x,z) coordinate
Location ret = new Location(w,
RandomUtil.nextIntBetween(min.getBlockX(), max.getBlockX()) + 0.5,
RandomUtil.rand.nextInt(min.getBlockX(), max.getBlockX()) + 0.5,
w.getMaxHeight() - 1,
RandomUtil.nextIntBetween(min.getBlockZ(), max.getBlockZ()) + 0.5);
RandomUtil.rand.nextInt(min.getBlockZ(), max.getBlockZ()) + 0.5);
// find a secure y value
ret = getSecureLocationOrNull(ret);