More fixes

This commit is contained in:
paulevsGitch 2021-04-04 12:16:00 +03:00
parent f76ca1144d
commit fd093318c6
2 changed files with 9 additions and 2 deletions

View file

@ -43,7 +43,12 @@ public class CrashedShipFeature extends NBTStructureFeature {
@Override @Override
protected boolean canSpawn(StructureWorldAccess world, BlockPos pos, Random random) { protected boolean canSpawn(StructureWorldAccess world, BlockPos pos, Random random) {
return pos.getY() > 58 && world.getBlockState(pos.down()).isIn(EndTags.GEN_TERRAIN); long x = pos.getX() >> 4;
long z = pos.getX() >> 4;
if (x * x + z * z < 3600) {
return false;
}
return pos.getY() > 5 && world.getBlockState(pos.down()).isIn(EndTags.GEN_TERRAIN);
} }
@Override @Override

View file

@ -63,9 +63,11 @@ public class IslandLayer {
positions.clear(); positions.clear();
for (int pox = -1; pox < 2; pox++) { for (int pox = -1; pox < 2; pox++) {
int px = pox + ix; int px = pox + ix;
long px2 = px;
for (int poz = -1; poz < 2; poz++) { for (int poz = -1; poz < 2; poz++) {
int pz = poz + iz; int pz = poz + iz;
if (GeneratorOptions.noRingVoid() || (long) px + (long) pz > options.centerDist) { long pz2 = pz;
if (GeneratorOptions.noRingVoid() || px2 * px2 + pz2 * pz2 > options.centerDist) {
RANDOM.setSeed(getSeed(px, pz)); RANDOM.setSeed(getSeed(px, pz));
double posX = (px + RANDOM.nextFloat()) * options.distance; double posX = (px + RANDOM.nextFloat()) * options.distance;
double posY = MHelper.randRange(options.minY, options.maxY, RANDOM); double posY = MHelper.randRange(options.minY, options.maxY, RANDOM);