Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7248

Bone mealing grass triggers piston block update detector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 3645-Spigot-19641c7-7cd3244 (MC: 1.19.3)
    • Yes

      How to reproduce:

      1. Build the contraption in the attachments (both pistons are sticky).
      2. Use bone meal on the grass block.
      3. A grass/tall grass/flower appears and both pistons fire.

      In vanilla the piston with the slime block on top doesn't fire.

      I did some testing and this are the results:

      1. The grass/tall grass/flower gets placed in the world with the "i" argument (i.e. the placement flags) equal to 2. This if-block captures it: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/level/World.patch#144. Note that the flags argument is captured during the construction of the new CapturedBlockState.
      2. Later on, I believe the captured grass/tall grass/flower gets actually placed from here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/item/ItemStack.patch#146.
      3. It calls down to here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java#217. Note that the flag field of CraftBlockState isn't used here. This eventually calls the method in point 1 again but with flags argument equal to 3 instead of 2.

      I think the whole issue stems from the fact that the original placement flags are ignored when the grass/tall grass/flower is actually placed in the world.

            Unassigned Unassigned
            Traks Traks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: