Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect caching of biome columns #1

Open
ExeRSolver opened this issue Jun 11, 2024 · 0 comments
Open

Incorrect caching of biome columns #1

ExeRSolver opened this issue Jun 11, 2024 · 0 comments

Comments

@ExeRSolver
Copy link

The result of getBiomeColumnAt can change if the method is first invoked with different block coords in the same chunk (using the same TerrainGenerator object). For example, the code below outputs "minecraft:grass_block" (which is correct)

public static void main(String[] args) {
        MCVersion version = MCVersion.v1_16_1;
        long seed = 46;
        OverworldBiomeSource biomeSource = new OverworldBiomeSource(version, seed);
        OverworldTerrainGenerator terrainGenerator = new OverworldTerrainGenerator(biomeSource);

        System.out.println(terrainGenerator.getBiomeColumnAt(165, 162)[67]);
    }

However the following code outputs "minecraft:air"

    public static void main(String[] args) {
        MCVersion version = MCVersion.v1_16_1;
        long seed = 46;
        OverworldBiomeSource biomeSource = new OverworldBiomeSource(version, seed);
        OverworldTerrainGenerator terrainGenerator = new OverworldTerrainGenerator(biomeSource);

        terrainGenerator.getBiomeColumnAt(170, 175);
        System.out.println(terrainGenerator.getBiomeColumnAt(165, 162)[67]);
    }

I believe this is caused by generateBiomeColumnBefore. In particular, I think that x, z should instead be posX, posZ here:

Block[] buffer = columnProvider.apply(x, z);
this.replaceBiomeBlocks(buffer, x, z, rand);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant