Skip to content

Incorrect caching of biome columns #1

Description

@ExeRSolver

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions