mojira.dev
MC-2813

Snow doesn't form / cannot be placed on upside down slabs / stairs

When you have an upside down slab and it is snowing in the game, the snow will land on whole blocks but not upside down slabs. I believe that this is a bug because you can place red stone, torches, and other things on slabs, but snow doesn't fall on them.

Linked issues

Attachments

Comments 25

This is most likely because half-slabs are transparent. You will notice that snow also does not show up on glass, etc. Does this bug apply to double half-slabs?

Confirmed.
On all double slabs snow does form.

Nor can you place the new snow blocks on these, as of 13w05b

Seeing as redstone and rails can be placed on top slabs and upside down stairs this is more a bug than an unimplemented feature.

Fix
Pretty much a rewrite (at least when compared to MCP version).

BlockSnow

public boolean canPlaceBlockAt(World world, int x, int y, int z) {
        int blockId = world.getBlockId(x, y - 1, z);
        if (blockId == 0)
            return false;
        if (blockId == Block.glass.blockID || blockId == Block.leaves.blockID)
            return true;
        if (Block.blocksList[blockId].isOpaqueCube()) {
            if (world.getBlockMaterial(x, y - 1, z).blocksMovement())
                return true;
        }
        // Check the top surface more accurately, the fix for halfslabs:
        if (world.doesBlockHaveSolidTopSurface(x, y-1, z))
            return true;
        
        return false;
    }

And then remove some unnecessary checks in World:

World.canSnowAt()

...
                int blockIdUnder = this.getBlockId(x, y - 1, z);
                int blockIdOver = this.getBlockId(x, y, z);
                if (blockIdUnder != 0 && blockIdOver == 0
                        && Block.snow.canPlaceBlockAt(this, x, y, z)
                        /*&& blockIdUnder != Block.ice.blockID && Block.blocksList[blockIdUnder].blockMaterial.blocksMovement()*/) {
                    return true;
                }
            ...

Note, added the glass block separately. Does not make sense to allow snow on top of leaves (pretty non-solid stuff), but disallow it on top of smooth solid chunk of glass, especially when torches have similar special check. Easy to remove if really not intended. Also, moved the leaves check to that simpler 'if', as it does not need to check for blocksMovement, at least for now.

I would have added ice, too, but noticed the specific disallowing in the current World.canSnotAt() method. Though I wonder why so, and wonder why the check was there and not in the method in BlockSnow.)

Changes tested on 1.4.7. Adding screenshot 'fixed_snow.png' to show results. Snow near the torches (except on furnace blocks) is hand placed, while the snow nearer has rained on the blocks.

15 more comments

Barriers is Working as Intended. Removed from the ticket title.

The screenshot from the fix provided by @unknown might be a little bit irritating

Marcono1234, please explain... Irritating? It has been there for years now, and I fail to find anything irritating in it, except the obnoxious falling snow disturbing the view... (Btw, I can not make a new screenshot of the fixed state; all my old various fixed MC versions I made back then are long gone now.)

What I meant was that having a screenshot of the fixed situation might make people think that it is fixed already. But it is probably not such a big deal

How do you know it affects 16w15b? You can't download it yet, it's in the process of being uploaded. (Neither client nor server are downloadable ATM.)

Edit: It can now.

nogluten

migrated

Confirmed

placement, slab, snow

Minecraft 1.4.2, Minecraft 1.4.4, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, ..., Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w14a

Minecraft 17w15a

Retrieved