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

biased_to_bottom, very_biased_to_bottom, and trapezoid height providers log spam warnings when configured with an empty range

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w05b
    • Confirmed
    • Data Packs, World generation
    • Low
    • Platform

      When, in a datapack, a placed feature is using a biased_to_bottom, very_biased_to_bottom, or trapezoid height provider with an empty range, a warning is logged every time a feature is generated. This is in contrast to the uniform height provider, which only prints it once for each combination of heights.

      How to reproduce:

      1. Create a new world with the attached "empty_uniform.zip" datapack
      2. In the log, a single Empty height range: [30 absolute-29 absolute] warning is written.
      3. Create a new world with the attached "empty_trapezoid.zip" datapack
      4. The log is spammed with Empty height range: triangle (30 absolute-29 absolute) warnings.

      Both datapacks modify the minecraft:ore_copper placed feature to use a height range (min: absolute 30 - max: absolute 29) in a uniform or trapezoid height provider respectively.

      Code analysis

      The UniformHeight class has a special check to only print each warning once:

      if (this.warnedFor.add((long)i << 32 | (long)j)) {
      	LOGGER.warn("Empty height range: {}", this);
      }
      

      I believe this to have been introduced as part of the fix of MC-236723. However the other height providers do not have this check, thus spamming warnings.

            Unassigned Unassigned
            CC_fan jacobsjo
            Votes:
            5 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: