Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-266877

(Trap-)Doors never occlude light (event if opaque)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.2, 23w46a
    • None
    • Unconfirmed
    • (Unassigned)

      The following block states do not occlude light event though, they are fully opaque (which is contrary to the expectation):

      Trapdoors:

      spruce, birch, dark oak

       

      Doors:

      spruce, birch, dark oak, mangrove, warped, crimson

      as well as all lower halves except acacia and cherry (cherry only due to two texels)

       

      Resolution:

      According to my own untested analysis (off mojang+yarn-spigot deobfuscated server code), this issue should be resolved, by not calling .noOcclusion() on the specified trapdoors and doors in the Blocks class,
      as well as adding:

      ```
      public boolean useShapeForLightOcclusion(BlockState state)

      { return true; }

      ```

      to the DoorBlock and TrapDoorBlock classes.

       

      Additionally (at least for the doors that need only one half corrected)

      ```
      public VoxelShape getOcclusionShape(BlockState state, BlockGetter world, BlockPos pos);
      ```

      has to be overwritten to return Shapes.empty() if the half includes transparency.

       

        1. 2023-11-20_11.34.47.png
          631 kB
          MoritzR200
        2. 2023-11-20_12.14.32.png
          426 kB
          MoritzR200

            Unassigned Unassigned
            MoritzR200 MoritzR200
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: