Skip to content

Wrong logic when a minecart is hooked by a fishing rod #2152

@melvuze

Description

@melvuze

WorldEdit Version

7.3.6

WorldGuard Version

7.0.9

Platform Version

git-Paper-497 (MC: 1.20.4)

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using a version of WorldGuard compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

If you try to hook a minecart in a region with a opening chests flag (CHEST_ACCESS), you will not be able to do this and will receive the message in response: “Sorry, but you cant. open that here.”

Expected Behavior

Instead, it should be possible to hook a minecart and the ban on hooking should be
implemented as a new flag. The message should be something like "Sorry, but you can't move that" or something like that.

Reproduction Steps

  1. Create a region with default flags
  2. Remove yourself from it
  3. Try hook a minecart

Optional WorldGuard-Report

No response

Anything Else?

While reviewing the source code, I identified a problem. Apparently, any interaction if the entity is considered a building and is a minecart is considered opening inventory. However, this is not true. The fishing rod hook also execute this code.
(RegionProtectionListener line 422) I think it's also worth adding a flag for fishing rod situations. If there are other ways to allow just hooking, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:acceptedWill be fixed / added to WorldGuard, eventuallytype:bugIncorrect behavior, not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions