Mojira Archive
MC-109503

Layered snow block incorrect collision / metadata match up

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;

Works As Intended

Kevin Gagnon

ProfMobius (Thomas Guimbretiere)

2016-11-01, 03:00 PM

2021-08-19, 01:39 AM

2016-11-01, 03:04 PM

0

1

Unconfirmed

Minecraft 1.10.2

-