diff --git a/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/AbstractBiomeProvider.java b/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/AbstractBiomeProvider.java index 75bd5c3..5442ed5 100644 --- a/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/AbstractBiomeProvider.java +++ b/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/AbstractBiomeProvider.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableSet; import net.minecraft.util.math.BlockPos; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; +import net.minecraft.world.biome.ColumnFuzzedBiomeMagnifier; import java.util.List; import java.util.Random; @@ -42,11 +43,6 @@ public abstract class AbstractBiomeProvider extends net.minecraft.world.biome.pr super(defaultBiomes); } - @Override - public final Biome getNoiseBiome(int x, int y, int z) { - return getBiome(x, y, z); - } - @Override public final Set func_225530_a_(int x, int y, int z, int size) { return getBiomesInSquare(x, y, z, size); @@ -57,8 +53,6 @@ public abstract class AbstractBiomeProvider extends net.minecraft.world.biome.pr return findBiomePosition(centerX, centerY, centerZ, range, biomes, random); } - public abstract Biome getBiome(int x, int y, int z); - public abstract Set getBiomesInSquare(int x, int y, int z, int size); public abstract BlockPos findBiomePosition(int centerX, int centerY, int centerZ, int range, List biomes, Random random); diff --git a/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/BiomeProvider.java b/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/BiomeProvider.java index 2c04e10..9d5c405 100644 --- a/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/BiomeProvider.java +++ b/TerraForgedMod/src/main/java/com/terraforged/mod/biome/provider/BiomeProvider.java @@ -28,7 +28,6 @@ package com.terraforged.mod.biome.provider; import com.google.common.collect.Sets; import com.terraforged.core.cell.Cell; import com.terraforged.core.region.chunk.ChunkReader; -import com.terraforged.core.util.concurrent.ObjectPool; import com.terraforged.core.world.decorator.Decorator; import com.terraforged.core.world.terrain.Terrain; import com.terraforged.mod.biome.map.BiomeMap; @@ -63,11 +62,13 @@ public class BiomeProvider extends AbstractBiomeProvider { } @Override - public Biome getBiome(int x, int y, int z) { - try (ObjectPool.Item> item = Cell.pooled()) { - context.heightmap.apply(item.getValue(), x, z); - return getBiome(item.getValue(), x, z); - } + public Biome getNoiseBiome(int x, int y, int z) { + // I don't know why +24, just seems to provide slightly more accurate results + x = (x << 2) + 24; + z = (z << 2) + 24; + Cell cell = new Cell<>(); + context.heightmap.apply(cell, x, z); + return getBiome(cell, x, z); } @Override diff --git a/TerraForgedMod/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java b/TerraForgedMod/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java index ed98495..bf1b8b7 100644 --- a/TerraForgedMod/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java +++ b/TerraForgedMod/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java @@ -49,7 +49,6 @@ import com.terraforged.feature.predicate.MinHeight; import com.terraforged.feature.template.type.FeatureTypes; import com.terraforged.mod.Log; import com.terraforged.mod.biome.provider.BiomeProvider; -import com.terraforged.mod.biome.provider.TerraBiomeManager; import com.terraforged.mod.chunk.fix.ChunkCarverFix; import com.terraforged.mod.chunk.fix.RegionFix; import com.terraforged.mod.decorator.ChunkPopulator; @@ -92,7 +91,6 @@ public class TerraChunkGenerator extends ObfHelperChunkGenerator generator, TemplateManager templates) { - super.generateStructures(biomeManager, chunk, this, templates); + super.generateStructures(unused, chunk, this, templates); } @Override @@ -188,7 +185,7 @@ public class TerraChunkGenerator extends ObfHelperChunkGenerator generator; - public RegionFix(WorldGenRegion region, TerraContainer container, ChunkGenerator generator, BiomeManager biomeManager) { + public RegionFix(WorldGenRegion region, ChunkGenerator generator) { super(region.getWorld(), region); - this.region = region; - this.container = container; this.generator = generator; - this.biomeManager = biomeManager; } @Override @@ -61,50 +47,4 @@ public class RegionFix extends RegionDelegate { public int getMaxHeight() { return generator.getMaxHeight(); } - - @Override - public BiomeManager func_225523_d_() { - return biomeManager; - } - - @Override - public Biome getNoiseBiome(int x, int y, int z) { - return getBiome(x, y, z); - } - - @Override - public Biome getNoiseBiomeRaw(int x, int y, int z) { - return getBiome(x, y, z); - } - - @Override - public Biome getBiome(BlockPos pos) { - return getBiome(pos.getX(), pos.getY(), pos.getZ()); - } - - private Biome getBiome(int x, int y, int z) { - int chunkX = x >> 4; - int chunkZ = z >> 4; - if (chunkX == region.getMainChunkX() && chunkZ == region.getMainChunkZ()) { - return container.getBiome(x, z); - } - - TerraContainer container = getBiomes(chunkX, chunkZ); - if (container == null) { - return generator.getBiomeProvider().getNoiseBiome(x, y, z); - } - - return container.getBiome(x, z); - } - - private TerraContainer getBiomes(int chunkX, int chunkZ) { - IChunk chunk = getChunk(chunkX, chunkZ, ChunkStatus.BIOMES, false); - if (chunk != null) { - BiomeContainer container = chunk.getBiomes(); - if (container instanceof TerraContainer) { - return (TerraContainer) container; - } - } - return null; - } }