Skip to content

[BUG] Incorrect logging and rollback of water placement when sneak+placing a water bucket on waterloggable block #858

@guss-alberto

Description

@guss-alberto

Steps to reproduce

  1. place any waterloggable block
  2. shift+click with a water bucket on any side of the waterloggable block
  3. enable inspector with /co i
  4. inspect the water placed on top and any water that spreads

(optional)

  1. run /co rollback t:10m r:10
  2. run /co undo

Expected result

The water, and any place it flows in should be logged as being placed by the user (e.g. + Intelli placed water.).

Rolling back and restoring should return the same structure that was built.

Observed results

The water is logged as being placed inside the waterloggable block itself, instead of on top of it.

Any water that flowed from it is then logged as #water ( + #water placed water.) instead of being placed by the user as expected.

This means user-based rollbacks don't roll back the water properly, and restores produce an incorrect result.

Image

The structure on the LEFT was is what was placed, the structure on the RIGHT is what was placed by the rollback+restore, with the waterlogged stairs instead of the water on top .

This is most likely due to the fix of MC-173730 in Minecraft 1.21.9. Logging works as expected in previous versions.

Possible fix

Implement version and player sneaking check in PlayerBucketEmptyListener.
Use event.getBlock() instead of event.getBlockClicked() if possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions