mojira.dev
MC-265046

Conduit Power cannot apply to entities in the rain while inside/next to non-full blocks

The Bug:

When the player is standing inside of a position with a non-full block (both at the foot and head) which does not occlude the sky, the conduit power effect will not be applied.

Steps to Reproduce:

  1. Set weather to rain

    /weather rain
  1. Replicate the following setup:

    [media]

Observed Results:

The player will not be given the conduit power effect.

[media]

Expected Results:

The player would be given the conduit power effect as they are underneath rainfall overhead.

[media]

Screenshots/Videos:

The player is immediately given the conduit power effect after leaving the two trapdoors:

[media]

Code Analysis:

This is because of the isRainingAt() method in Level.java (net.minecraft.world.level)
which chcecks the heightmap type of a given block position is "MOTION_BLOCKING".

public boolean isRainingAt(BlockPos blockPos) {
      if (!this.isRaining()) {
         return false;
      } else if (!this.canSeeSky(blockPos)) {
         return false;
      } else if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, blockPos).getY() > blockPos.getY()) {
         return false;
      } else {
         Biome biome = this.getBiome(blockPos).value();
         return biome.getPrecipitationAt(blockPos) == Biome.Precipitation.RAIN;
      }
   }

Attachments

Comments 0

No comments.

[Mod] Jingy

(Unassigned)

Confirmed

Block states

1.20.1, 23w33a

Retrieved