Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-217802

Some blocks generate at wrong Y height in a superflat world

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w11a
    • 21w08b, 21w10a
    • None
    • Confirmed
    • (Unassigned)

      The bug

      minecraft:grass, minecraft:flower_pot, carpets, snow and possibly more blocks generate on the wrong y level if min_y is below 0. (y of wrong level blocks = amount of layers) Basically forgets there are negative y levels.

       

      How to reproduce

      1. Go to the flat world preset menu
      2. Fill in minecraft:bedrock,2*minecraft:dirt,minecraft:grass_block,minecraft:grass (you can replace grass with flower_pot or white_carpet for the same effect)
      3. Generate the world
         The grass generated at y = 4  

      Code analysis

      Using the official 21w08b mojmaps:

      net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings
      
      public int getMinBuildHeight() {
        return 0;
      }
          
      public int getHeight() {
        return 256;
      }
      

      These are hardcoded to the old limit, multiple things are calculated with that number, including the level height of the blocks like carpets, grass and snow etc(blocks that depend on blocks below it, flower_pot is a weird exception). Best solution is unhardcoding these.

            Roq12 Thommy Siverman
            Tycho Los BBLZ
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: