Shopkeepers

Shopkeepers

2M Downloads

Villagers editor GUI inaccessible via shift-right-click after filling inventory of villager without a profession

Daedalus11069 opened this issue · 5 comments

commented

Preliminaries:

  • Shopkeepers version: 2.12.0
  • Spigot version: CraftBukkit version 3029-Spigot-79d53c2-e9ad7cb (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)

  • I have checked that my issue/question does not get answered by:
  • I have checked all open and closed issues, but none seems to fit my issue/question.

Reproduction on a fresh and up-to-date Spigot server:

I was able to reproduce my issue on a freshly setup and up-to-date Spigot server (currently CraftBukkit version 3029-Spigot-79d53c2-e9ad7cb (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)) with the latest version of Shopkeepers (currently 2.12.0), with no other plugins and with no kinds of other server or client mods.

The issue:

When trying to access the villager-editor screen via shift-right-clicking after putting items in a villager's trade area of the gui and closing said gui, opening that gui becomes impossible via the shift-right-click for that villager, and any other villagers that it(opening the gui at all) is attempted on.

The villager in question this is attempted on initially does not hold a profession, however the bug persists when it obtains a profession.

I am not closing the gui manually. Here is a gif to demonstrate:

Demonstration

Restarting the server, nor reloading the plugin through the plugin's command helps(/shopkeeper reload).

Expected behavior:

The ability open the villager-editor gui without it immediately closing, preventing interaction with said gui.

Steps to reproduce:

  • Spawn a villager or find one that has no profession.
  • Shift-right-click said villager to open the gui and put 1 item in the cost slot, and one item in the stock slot.
  • Close the villager-editor gui.
  • Try to open the gui again on that, or any other villager via shift-right-clicking.

Server Logs:

[03:49:51] [Server thread/INFO]: [Shopkeepers] Player Daedalus11069 is interacting (HAND) at entity at Location{world=CraftWorld{name=Testing World},x=-260.5,y=5.0,z=201.5,pitch=-9.754557,yaw=212.18292}
[03:49:51] [Server thread/INFO]: [Shopkeepers]   Non-shopkeeper
[03:49:51] [Server thread/INFO]: [Shopkeepers] Player Daedalus11069 is interacting (HAND) with entity at Location{world=CraftWorld{name=Testing World},x=-260.5,y=5.0,z=201.5,pitch=-9.754557,yaw=212.18292}
[03:49:51] [Server thread/INFO]: [Shopkeepers]   Non-shopkeeper
[03:49:51] [Server thread/INFO]: [Shopkeepers] Interaction with non-shopkeeper villager ..
[03:49:51] [Server thread/INFO]: [Shopkeepers]   possible villager editor request ..
[03:49:51] [Server thread/INFO]: [Shopkeepers] Opening UI 'villager-editor' ...
[03:49:51] [Server thread/INFO]: [Shopkeepers] UI 'villager-editor' session started for player 'Daedalus11069'.
[03:49:51] [Server thread/INFO]: [Shopkeepers]     ..success (normal trading prevented).
[03:49:51] [Server thread/INFO]: [Shopkeepers] Player Daedalus11069 is interacting (OFF_HAND) at entity at Location{world=CraftWorld{name=Testing World},x=-260.5,y=5.0,z=201.5,pitch=-9.754557,yaw=212.18292}
[03:49:51] [Server thread/INFO]: [Shopkeepers]   Non-shopkeeper
[03:49:51] [Server thread/INFO]: [Shopkeepers] Player Daedalus11069 is interacting (OFF_HAND) with entity at Location{world=CraftWorld{name=Testing World},x=-260.5,y=5.0,z=201.5,pitch=-9.754557,yaw=212.18292}        
[03:49:51] [Server thread/INFO]: [Shopkeepers]   Non-shopkeeper
[03:49:51] [Server thread/INFO]: [Shopkeepers] Interaction with non-shopkeeper villager ..
[03:49:53] [Server thread/INFO]: [Shopkeepers] Inventory click: player=Daedalus11069, view-type=CHEST, view-title=ºaVillager Editor: ºeVillager, raw-slot-id=76, slot-id=4, slot-type=QUICKBAR, shift=true, hotbar key=-1, left-or-right=left, click-type=SHIFT_LEFT, action=MOVE_TO_OTHER_INVENTORY, time: 17073983
[03:49:53] [Server thread/INFO]: [Shopkeepers] Inventory click: player=Daedalus11069, view-type=CHEST, view-title=ºaVillager Editor: ºeVillager, raw-slot-id=77, slot-id=5, slot-type=QUICKBAR, shift=false, hotbar key=-1, left-or-right=left, click-type=LEFT, action=PICKUP_ALL, time: 17074476
[03:49:54] [Server thread/INFO]: [Shopkeepers] Inventory dragging: player=Daedalus11069, view-type=CHEST, view-title=ºaVillager Editor: ºeVillager, drag-type=EVEN
[03:49:56] [Server thread/INFO]: [Shopkeepers] Player Daedalus11069 closed UI 'villager-editor'.
[03:49:56] [Server thread/INFO]: [Shopkeepers] UI 'villager-editor' session ended for player 'Daedalus11069'.
commented

I cannot reproduce this. In my testing, I only receive the first two 'interaction (HAND)' events, but not the two (interaction (OFF_HAND)' events afterwards. Can you try to reproduce this without any client-side mods?

commented

Unable to reproduce without any client-side mods. I should have tested that first, though in my defense I was doing this at almost 4 am. That said I realize this is likely not a huge deal because of those client-side mods, so if this needs to be closed, then so be it.

That said further, however; with this knowledge I narrowed it down to Forge. Version doesn't immediate seem to matter, though it's been tested with forge-36-.1.3 and 36.0.63 with no change in behavior and all client-side mods turned off. I'm obviously going to work on this on my end if not likely submit an issue report to forge or something. Either way, sorry here.

commented

Either way, sorry here.

No, that's totally fine. Now I at least know that this kind of incompatibility with Forge exists. So thank you for investigating and tracking it down to Forge specifically.

likely submit an issue report to forge

Please keep me updated on this. Maybe this ticket is related, however, it seems to be about item interactions, and it has been closed for inactivity: MinecraftForge/MinecraftForge#5508
You could also check if there are other related differences in the interaction behavior between Forge and Vanilla. For example, try interacting with the villager while holding certain interactable items in your hand (apple, trident, written book, ..). If you find a case in which Forge diverges from Vanilla behavior, the chances might be better for getting this resolved in Forge, compared to if this only affects the compatibility with a small list of server side plugins such as Shopkeepers.

If this doesn't end up getting fixed in Forge, then it might maybe even be possible for Shopkeepers to detect and cancel these additional offhand interactions when we handled and cancelled the earlier main hand interaction. I will keep this ticket open until I find the time to further look into this.

commented

I made a small change in an attempt to cancel these additional off-hand villager interactions. Can you let me know if this resolves this issue? You can find a snapshot of this version here: https://nexus.lichtspiele.org/repository/snapshots/com/nisovin/shopkeepers/Shopkeepers/2.13.0-SNAPSHOT/Shopkeepers-2.13.0-20210401.223150-1.jar

However, this snapshot also contains several other changes that are still prone to change until the final release of 2.13.0. Depending on the changes that are yet to come, upgrading from this snapshot to the actual v2.13.0 version later might not be properly supported. See the full changelog and migration notes so far here: https://github.com/Shopkeepers/Shopkeepers/blob/master/CHANGELOG.md.

commented

Keep me updated

Will do; though it will likely be a bit before I submit that bug report, as I'm not used to reporting forge bugs. That said, will definitely keep you updated when that happens.

I made a small change

That change fixed the issue for me. Even tested it with all my client side mods enabled and it still worked.

However, this snapshot also contains several other changes

I'll keep that in mind as well.