Closed gkhaavik closed 3 years ago
That's weird, what SmartInvs and Spigot versions are you using?
Using latest smartInv 1.2.7 and latest paper spigot
I should probably mention I have 2 plugins on my server that uses SmartInvs seperately
I am still having this issue
Please fix this :)
Not able to reproduce the issue, can you provide some short code which shows the issue please?
First of all I have 2 plugins using the SmartInvs library, which I have noticed to cause some trouble when using plugman to reload one of those plugins.
How I create Menus https://pastebin.com/DP1cfxLr My MenuProvider https://pastebin.com/0cVUyiib If the player right-clicks or left-clicks with a specific item, it should open a menu. This is done using PlayerInteractEvent. It works great the first time the player does it, but when the menu is open and the player clicks on the interactableitems, while having the specific item in their hand. It does the interactableitem action first and afterwards just reopens the menu, so it looks like nothing happens.
Are the 2 plugins providing their own version of SmartInvs inside the jars, or are they directly using the SmartInvs plugin from the plugins folder as a dependency?
They providing their own with maven repo
They are*
Then that may be the problem, if two different InventoryManager are initialized, maybe it causes some conflicts
Yeah I know, that why I mentioned it but what should I do? I dont want to have people require the plugin as a dependecy.
You can put the API in one of the plugin, and making the second plugin depend on the first one
It is two completly different plugins
Can you check with only one of those 2 plugins to see if the problem is really caused by some kind of "conflict"?
I have checked, when I only have one of the plugins on, plugman reload works great, but when both, thats when I get the error.
Maybe if you relocate the SmartInvs package inside one of your plugin, so they don't get considered as the same plugin?
If that doesn't work, then I don't know any other solution than using SmartInvs in a standalone plugin, but if you don't want users to need to manually download it, maybe you can provide it inside a zip file besides your plugin, or make it automatically download SmartInvs from the Github Releases page
I noticed that at some point in this thread, I changed subject, the issue was that PlayerInteractEvent was being called clicking on interactable items inside a SmartInventory menu.
I don't understand what's causing the PlayerInteractEvent call, since it's called nowhere in our code
Do you know what I mean?
Yeah I think I understand the problem, but I don't know what could be the cause. Is this problem still happening when only one of the two plugins is enabled?
PlayerInteractEvent is getting called when clicking on a clickable item that is not empty, it is causing a bug since I am trying to open a menu when player clicks with a specific item.
https://giphy.com/gifs/KbvhGts33HSVNpMQxq