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
is duplicated by 6
relates to 1
Attachments
Comments 25
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.
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
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?