mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 08:30:59 +00:00
Fixed y-level off-by-one issue on random spawn
Fixed wall-suffocation issue on random spawn
This commit is contained in:
@@ -155,8 +155,8 @@ public class RandomSpawn extends JavaPlugin{
|
||||
double r = exclusionRadius + Math.random() * (radius - exclusionRadius);
|
||||
double phi = Math.random() * 2d * Math.PI;
|
||||
|
||||
double x = center.getX() + Math.cos(phi) * r;
|
||||
double z = center.getZ() + Math.sin(phi) * r;
|
||||
double x = Math.round(center.getX() + Math.cos(phi) * r);
|
||||
double z = Math.round(center.getZ() + Math.sin(phi) * r);
|
||||
|
||||
result.setX(x);
|
||||
result.setZ(z);
|
||||
@@ -230,6 +230,7 @@ public class RandomSpawn extends JavaPlugin{
|
||||
blockid = world.getBlockTypeIdAt((int) x, (int) y, (int) z);
|
||||
}
|
||||
if(y == 0) return -1;
|
||||
y++;
|
||||
}
|
||||
|
||||
if (blacklist.contains(blockid)) return -1;
|
||||
|
||||
Reference in New Issue
Block a user