Fixed end generator

This commit is contained in:
paulevsGitch 2021-12-15 13:39:45 +03:00
parent d8de624fd1
commit 75b8257085

View file

@ -138,10 +138,10 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
@Override @Override
public Biome getNoiseBiome(int biomeX, int biomeY, int biomeZ, Climate.Sampler sampler) { public Biome getNoiseBiome(int biomeX, int biomeY, int biomeZ, Climate.Sampler sampler) {
long i = (long) biomeX * (long) biomeX; long posX = biomeX << 2;
long j = (long) biomeZ * (long) biomeZ; long posZ = biomeZ << 2;
long farEndBiomes = GeneratorOptions.getFarEndBiomes(); long farEndBiomes = GeneratorOptions.getFarEndBiomes();
long dist = i + j; long dist = posX * posX + posZ * posZ;
if ((biomeX & 63) == 0 && (biomeZ & 63) == 0) { if ((biomeX & 63) == 0 && (biomeZ & 63) == 0) {
mapLand.clearCache(); mapLand.clearCache();
@ -161,19 +161,19 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
} }
if (height < -10F) { if (height < -10F) {
return mapVoid.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); return mapVoid.getBiome(posX, biomeY << 2, posZ).getActualBiome();
} }
else { else {
return mapLand.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); return mapLand.getBiome(posX, biomeY << 2, posZ).getActualBiome();
} }
} }
else { else {
pos.setLocation(biomeX, biomeZ); pos.setLocation(biomeX, biomeZ);
if (endLandFunction.apply(pos)) { if (endLandFunction.apply(pos)) {
return dist <= farEndBiomes ? centerBiome : mapLand.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); return dist <= farEndBiomes ? centerBiome : mapLand.getBiome(posX, biomeY << 2, posZ).getActualBiome();
} }
else { else {
return dist <= farEndBiomes ? barrens : mapVoid.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); return dist <= farEndBiomes ? barrens : mapVoid.getBiome(posX, biomeY << 2, posZ).getActualBiome();
} }
} }
} }