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

Layered snow block incorrect collision / metadata match up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: Minecraft 1.10.2
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed

      Description

      The collision box for the layered snow block with 8 states has an off by 1 error. For example, if you place it with just 1 layer, you do not have any collision on it. If you place a full max amount of layers (8), you sink down 0.125.

      This is most noticeable if you put a half slab sized snow block next to the non layer-able variant of the full sized snow block, you cannot step up it.

      If this was intended behavior I figure the non layer-able variant of the snow block would also have this "sink in 0.125" behavior, but it does not.

      MCP Code snippets where the problem exists and how to fix:

      First fix:

      net.minecraft.block.BlockSnow.getCollisionBoundingBox:
      first line: int i = ((Integer)blockState.getValue(LAYERS)).intValue() - 1;
      to fix: remove the " - 1"
      to look like: int i = ((Integer)blockState.getValue(LAYERS)).intValue();

      Second fix:

      net.minecraft.block.BlockSnow.isFullyOpaque:
      the "== 7" should be "== 8"
      to look like: return ((Integer)state.getValue(LAYERS)).intValue() == 8;

        Attachments

          Activity

            People

            • Assignee:
              ProfMobius [Mojang] ProfMobius (Thomas Guimbretiere)
              Reporter:
              corosus Kevin Gagnon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: