From 75b8257085c938e9954a38fd284fa386f2c22366 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Wed, 15 Dec 2021 13:39:45 +0300 Subject: [PATCH] Fixed end generator --- .../bclib/world/generator/BCLibEndBiomeSource.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java index dad925a8..c7292a88 100644 --- a/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java @@ -138,10 +138,10 @@ public class BCLibEndBiomeSource extends BCLBiomeSource { @Override public Biome getNoiseBiome(int biomeX, int biomeY, int biomeZ, Climate.Sampler sampler) { - long i = (long) biomeX * (long) biomeX; - long j = (long) biomeZ * (long) biomeZ; + long posX = biomeX << 2; + long posZ = biomeZ << 2; long farEndBiomes = GeneratorOptions.getFarEndBiomes(); - long dist = i + j; + long dist = posX * posX + posZ * posZ; if ((biomeX & 63) == 0 && (biomeZ & 63) == 0) { mapLand.clearCache(); @@ -161,19 +161,19 @@ public class BCLibEndBiomeSource extends BCLBiomeSource { } if (height < -10F) { - return mapVoid.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); + return mapVoid.getBiome(posX, biomeY << 2, posZ).getActualBiome(); } else { - return mapLand.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); + return mapLand.getBiome(posX, biomeY << 2, posZ).getActualBiome(); } } else { pos.setLocation(biomeX, biomeZ); 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 { - return dist <= farEndBiomes ? barrens : mapVoid.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2).getActualBiome(); + return dist <= farEndBiomes ? barrens : mapVoid.getBiome(posX, biomeY << 2, posZ).getActualBiome(); } } }