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

Distribution of iron and coal ores has sharp jumps at particular heights

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: 21w08b
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Plausible
    • Category:
      World generation

      Description

      The bug

      The height generation of iron and coal ores jumps sharply at certain Y levels, due to overlapping of flat and ramped distributions. For coal it is around Y=136 and for iron it is a smaller jump at around Y=-8.

      This is happening for coal and iron because a flat ore distribution overlaps with the tail of a triangular distribution but the flat distribution does not extend over the whole of the triangular distribution. Compare this to the likely correct behaviour of redstone ore above Y=-64 where the flat distribution does not overlap in this way above Y=-64. However, redstone ore may also be affected below Y=-64 if the flat distribution ends before the triangular distribution (I have not tested this because it requires a custom world).

      This is a mathematical problem in the code and it can be fixed with a mathematical solution. Two fixes are possible: (1) Create a "ramp" distribution that behaves like a triangular distribution but only extending in one direction. The ramp can be combined with a flat distribution to create ramps. (2) Amend the triangular distribution to include a maximum value.

      How these fixes would look with a simplified numeric progression. (1) 0, 1, 2, 3, 4, 5, 0. (2, clamped at 4) 0, 1, 2, 3, 4, 4, 4, 4, 4, 3, 2, 1, 0.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hkniberg [Mojang] Henrik Kniberg
              Reporter:
              bdm68 bdm68
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: