Wrong PLAINS biome during custom chunk generation

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:
    • This server is running CraftBukkit version 3358-Spigot-dbf4938-8b98c8e (MC: 1.18) (Implementing API version 1.18-R0.1-SNAPSHOT)
    • Yes

      With Spigot 1.18, I've noticed strange behavior during the custom chunk generation.

      When a new ChunkData is generated, the entire chunk is jungle biome but, from 0 to 15 in height, it is plains biome.

      I've used the following code to test it.

      package it.gamerover.generator;
      
      import org.bukkit.Bukkit;
      import org.bukkit.Material;
      import org.bukkit.World;
      import org.bukkit.block.Biome;
      import org.bukkit.block.data.BlockData;
      import org.bukkit.generator.ChunkGenerator;
      import org.bukkit.generator.WorldInfo;
      import org.jetbrains.annotations.NotNull;
      
      import java.util.Random;
      
      @SuppressWarnings("deprecation")
      public class TestChunkGenerator extends ChunkGenerator {
      
          private static final BlockData DIRT  = Bukkit.createBlockData(Material.DIRT);
          private static final BlockData GRASS = Bukkit.createBlockData(Material.GRASS_BLOCK);
      
          @NotNull
          @Override
          public ChunkData generateChunkData(@NotNull World world,
                                             @NotNull Random random,
                                             int chunkX, int chunkZ,
                                             @NotNull ChunkGenerator.BiomeGrid biomeGrid) {
      
              ChunkData chunkData = createChunkData(world);
      
              for (int x = 0 ; x < 16 ; x++) {
      
                  for (int z = 0 ; z < 16 ; z++) {
      
                      biomeGrid.setBiome(x, z, Biome.JUNGLE);
      
                      for (int y = 0 ; y < 3 ; y++) {
                          chunkData.setBlock(x, y, z, DIRT);
                      }
      
                      chunkData.setBlock(x, 3, z, GRASS);
      
                  }
      
              }
      
              return chunkData;
      
          }
      
      } 

      This issue is repeated for each generated biome of the world.

      I have also attached some screenshots taken with the Vanilla Minecraft 1.18 client to visually explain the issue.

       

        1. 1.png
          1.png
          379 kB
        2. 2.png
          2.png
          657 kB
        3. 3.png
          3.png
          581 kB
        4. 4.png
          4.png
          385 kB

            Assignee:
            Marvin Rieple
            Reporter:
            gamerover98
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: