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

[BUG] Chests outside of shop plots. (Towny Compat) #394

Closed
roracle opened this issue Jul 29, 2022 · 6 comments
Closed

[BUG] Chests outside of shop plots. (Towny Compat) #394

roracle opened this issue Jul 29, 2022 · 6 comments

Comments

@roracle
Copy link

roracle commented Jul 29, 2022

Description

The problem:
Placing chests outside shop plots, including in the wild, makes them unbreakable except by hand.

Buggy Behavior:
On shop plots, chests work like usual. They can be broken with any item in hand. But when you place a chest outside of a shop plot, you must use an empty hand to break the chest on any other plot type.

Possible culprit:
This is likely being caused by compat-towny somewhere with Towny plots.

Steps to reproduce

With Towny running and a town created, make a shop plot and place a chest. You can break it with anything in hand.
Now place a chest in any other plot type (not shop) and try to break it with anything. You can only use an empty hand.

Expected Behaviour

Chests should work like normal everywhere and only work as QuickShop chests in shop plots.

Screenshots

not available

/qs paste URL

https://ghost-chu.github.io/quickshop-hikari-paste-viewer/?remote=https%3A%2F%2Fbytebin.lucko.me%2FIkKhccAs6S

Additional Context

No response

@Ghost-chu
Copy link
Owner

Ghost-chu commented Jul 29, 2022

works as expected

empty hand protection only works for owned shops creative mode etc. bank shops owned by town or nation, not protected by this feature.

@roracle
Copy link
Author

roracle commented Jul 29, 2022

Hey, the problem isn't with shops it's with regular chests.

I cannot destroy regular vanilla chests unless empty handed.

In shop plot (Towny), I can destroy vanilla chest. In all other plots I can't destroy vanilla chest.

This isn't a protection, this is a bug.

@Ghost-chu
Copy link
Owner

This is strange, Towny compat doesn't processing player breaks.

@roracle
Copy link
Author

roracle commented Jul 30, 2022

This is strange, Towny compat doesn't processing player breaks.

Strange it is. Here's the output with dev-mode enabled. I interrupt after each thing I do to comment on what I just did.

FROM A REGULAR PLOT:

[18:10:09 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_RIGHT_CLICK_SHOPBLOCK
[18:10:09 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: NONE
[18:10:19 INFO]: <roracle> Placed chest ^
[18:10:21 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:10:21 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:10:21 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:252) roracle : quickshop.create.sell -> true
[18:10:21 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:300) ShopPreCreateEvent cancelled
[18:10:43 INFO]: <roracle> Break attempt with item in hand ^
[18:10:47 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:10:47 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:10:51 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:10:51 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:11:03 INFO]: <roracle> Break attempt with EMPTY hand ^

FROM A SHOP PLOT:

[18:14:28 INFO]: <roracle> TESTING AGAIN, IN SHOP PLOT
[18:14:29 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_RIGHT_CLICK_SHOPBLOCK
[18:14:29 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: NONE
[18:14:33 INFO]: <roracle> Placed chest ^
[18:14:35 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:14:35 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:14:35 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:252) roracle : quickshop.create.sell -> true
[18:14:39 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:14:39 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:14:50 INFO]: <roracle> Break attempt with item in hand ^
[18:14:51 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_RIGHT_CLICK_SHOPBLOCK
[18:14:51 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: NONE
[18:14:56 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:14:56 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:15:00 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:15:00 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:15:05 INFO]: <roracle> Break attempt with EMPTY hand ^

Then there's this:
Not shop plot, clicking regular chest with hand -

[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION

Not shop plot, clicking regular chest with item -

[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:252) roracle : quickshop.create.sell -> true
[18:18:58 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:300) ShopPreCreateEvent cancelled

AND this:

IS a shop plot, clicking regular chest with hand -

[18:19:05 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:19:05 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION

IS a shop plot, clicking regular chest with item -

[18:19:09 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:119) Click: STANDING_LEFT_CLICK_SHOPBLOCK
[18:19:09 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#onClick:120) Behavior Mapping: TRADE_INTERACTION
[18:19:09 INFO]: [QuickShop-Hikari] [DEBUG] [Server thread/INFO] (PlayerListener#createShop:252) roracle : quickshop.create.sell -> true

My guess is QS should be ignoring everything about the chest unless it's in a shop plot. It should be asking if the plot you're in is a shop type plot before doing anything. QS shouldn't even trigger (as much as possible) if it isn't a shop or bank plot. It appears it is presuming it's a shop before the event needs to go through or be canceled, which may be causing the issue.

@Ghost-chu
Copy link
Owner

tried to fix in dc5f9ad

@roracle
Copy link
Author

roracle commented Jul 31, 2022

The issue appears solved.

@roracle roracle closed this as completed Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants