Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
6 tasks done
melvuze opened this issue Oct 23, 2024 · 1 comment
Closed
6 tasks done

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

melvuze opened this issue Oct 23, 2024 · 1 comment
Labels
status:accepted Will be fixed / added to WorldGuard, eventually type:bug Incorrect behavior, not working as intended

Comments

@melvuze
Copy link

melvuze commented Oct 23, 2024

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.

@melvuze melvuze added status:pending Pending acceptance or closure. type:bug Incorrect behavior, not working as intended labels Oct 23, 2024
@wizjany
Copy link
Collaborator

wizjany commented Nov 9, 2024

this is theoretically fixed (or at least, back to previous behavior). might need a separate vehicle-damage flag in the future to make behavior consistent across different vehicle types (as this issue is unique to chest minecarts, but e.g. #2137 is the same root cause)

@wizjany wizjany closed this as completed Nov 9, 2024
@wizjany wizjany added status:accepted Will be fixed / added to WorldGuard, eventually and removed status:pending Pending acceptance or closure. labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:accepted Will be fixed / added to WorldGuard, eventually type:bug Incorrect behavior, not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants