mojira.dev
MC-8858

Rain goes through upside-down stairs

Rain will fall through upside-down stairs when they are placed with no blocks above them. Screenshots aren't as good as I was hoping, but I think the gist of the issue is there. Small graphical bug otherwise.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media][media][media]
migrated

Is this actual rain or the rain droplets that drip from blocks?

migrated

Appears to be the rain droplets.

kumasasa

That's intended.
Rain goes through transparent blocks (Leaves) and stairs are transparent.

migrated

I thought they went through all blocks, but whatever.

kumasasa
migrated

Stairs are not leaves. Also, glass is transparent, and <s>water</s> - correction, rain - does not drip through glass. So there's an inconsistency in Kumasasa's explanation, so I don't think closing as 'Works as Intended' is appropriate.

shufboyardee

Simon, are you sure there is no still or running water above those upside-down stairs? Those blocks drip when water is directly above, though I could not reproduce it with rain.

migrated

I don't think this being marked as WAI is a good decision either.
In this case stairs do not generate driples but just look penetrable by rain. Penetration stops at lower third level of the block, where raindrops just dissappear. Such penetration also does not occur with upper slabs, fences, closed fence gates and even leaves albeit they all are transparent. Moreover leaves do generate dripples but are not penetrable by raindrops.

migrated

The animation for rain leaking through upside-down stairs and rain dripping through leaves is different. The stairs actually look leakier IMO. Something is wrong. Please reopen.

In addition, water (still or running) does NOT drip through anything other than upside-down stairs. I have a test building with normal stairs, upside down stairs, glass blocks, and leaves, and with spring blocks above each. Only the upside-down stairs leak at all! Mac Os 10.5.8. I've reported that separately as MC-9186

kumasasa

Reopened.

kumasasa

Made some coparison glass to upside down stairs to leaves.
In the hollow part of the upside down stairs the rain particles can be seen as through glass blocks. Leaves in fact drip very slowly.

So the summary of the ticket may be Rain particles are visible through upside-down stairs

bugi74

Testing
The rain particles have even more issues with top-half slabs and upside down stairs. I traced the reason for the particular case described in this issue, but when testing it on 13w09c (though probably same thing on 1.4.7), I noticed that there are even deeper issues.

I attached a screenshot showing my test setup ('testing_rain_particles.png'). When moving (move or turn) the reticle so it points on any of the stone slabs, the rain particles stop showing over all stone slabs (both left and right). And when moving the reticle over any of the stairs, the rain particles do not show over all of the stairs. (Though, there can be rarely a random one over the blocks not showing particles..) Correspondingly, if looking below the stairs, when reticle hits a stair block, the particles can be seen below the stairs, but once the reticle points to something else, no more "leaking" particles.

See the two other example screenshots ('with_particles.png' and 'without_particles.png') for comparison, and note the reticle aiming point.

Reason
A bit of related code:

EntityRenderer.addRainParticles()

...
    this.mc.effectRenderer.addEffect(
        new EntityRainFX(var3,
            (double) ((float) var17 + var22),
            (double) ((float) rainFloor + 0.1F) - Block.blocksList[blockId].getBlockBoundsMinY(),
            (double) ((float) var18 + var23)));
    ...

That getBlockBoundsMinY changes depending on whether the block type is "aimed" or not. This seems to be caused by a bit bad design of reusing those bounds to multiple purposes. Various pieces of code that use the method are supposed to ensure the representative block object has its bounds set to whatever purpose the caller needs. Apparently, in this case the bounds are still set up for something else than what is needed for calculating the rain hit level. (No need to say that this completely prevents multi-threading, too.)

Possible fix

Block block = Block.blocksList[blockId]; // ADDED (optimization)
    block.setBlockBoundsBasedOnState(var3, var17, rainFloor - 1, var18); // ADDED (fix)
    if (this.random.nextInt(var14) == 0) {
        xForSound = (double) ((float) var17 + var22);
        //yForSound = (double) ((float) rainFloor + 0.1F) - block.getBlockBoundsMinY();
        yForSound = (double) ((float) rainFloor + 0.1F) + block.getBlockBoundsMaxY() - 1; // FIX
        zForSound = (double) ((float) var18 + var23);
    }

    this.mc.effectRenderer.addEffect(
        new EntityRainFX(var3,
            (double) ((float) var17 + var22),
            //(double) ((float) rainFloor + 0.1F) - block.getBlockBoundsMinY(),
            (double) ((float) rainFloor + 0.1F) + block.getBlockBoundsMaxY() - 1, // FIX
            (double) ((float) var18 + var23)));

Basically, added the bounds setup before using them, and also fixed the way it calculates the height (it is the top of the block that defines where the rain drops appear, not the bottom). There is one more spot to fix the same, nearby before, for lava + rain effect (smoke).

Tested on 1.4.7 and seems to fix things. However, I didn't test extensively with other blocks; some new issues may appear.

bugi74

Affects 13w09c. and 1.4.7.

migrated

I'm seeing this issue in 13w25a.

I noticed that the actual rain from the sky isn't falling through and it doesn't look the same as water dripping from the underside of a block.

It appears to be:
rain falls on the blocks adjacent to the upside down stair
droplet bounces
bounced droplets that splash to the stair block pass through the stair.

Possibly all that code above describes the issue as accurately, but hopefully this plain language helps straighten it in the non-coders' minds.

migrated

Hate the new update where rain leaks through glass blocks and stone blocks. In real life, these materials would be mortared together and would not leak. Why would you make these materials leak in your game? It really puts a damper (pun intended) on architecture in Minecraft. Now, roofs and things look clunky, Please walk this "update" back a little.

migrated

migrated

Confirmed

rain, stairs, upside-down, water

Minecraft 1.4.7, Snapshot 13w05a, Snapshot 13w09c, Snapshot 13w23b, Snapshot 13w24a, Snapshot 13w24b, Snapshot 13w25a, Minecraft 1.7.4, Minecraft 14w08a

Minecraft 14w28a

Retrieved