myzticbean / QSFindItemAddOn

An Minecraft add-on plugin for the QuickShop Hikari and Reremake Shop plugins for Spigot server platform.
https://modrinth.com/plugin/shop-search
GNU General Public License v3.0
6 stars 4 forks source link

[Bug] Item Stock says unknown #17

Closed Kyrobi closed 4 months ago

Kyrobi commented 5 months ago

I'm using: QuickShop-Hikari (6.0.0.10) QSFindItemAddOn (2.0.5.6-RELEASE)

When I use the /finditem command, all the shops show up as unknown for their stock: image

However, when you go to the shop, the shop does indeed have items in the shop: image

myzticbean commented 5 months ago

@Kyrobi As per QS Hikari v6.0+, all stock/space values are now fetched from the Hikari database and doesn't load the chunk anymore to reduce lag. So, an unknown value means the stock/space value has not been cached yet in database by Hikari. I'll see what I can do.

myzticbean commented 4 months ago

@Kyrobi I have tried to fix this issue, but can you do me a favor and try it out on your server if it fixes the issue? You can find the link to download from below. https://modrinth.com/plugin/shop-search/version/2.0.5.7-SNAPSHOT Thanks!

Kyrobi commented 4 months ago

Sure! I'll try it out tomorrow. In the meantime, I wrote something to loop through all the chests and manually updated them. I'll clear my cache and try tomorrow.

Kyrobi commented 4 months ago

It seems like the plugin is correctly able to load the stocks. However, it spams the console with the debug message as follows (I'm not sure if it's still manually calling Shop#getRemainingStock() once all the items are in the cache)

image

And then for unlimited shops, it shows up as -1:

javaw_JHOEKMwp6Y

myzticbean commented 4 months ago

@Kyrobi does running the same exact command again still spam the console? Ideally once it has fetched stock value from store, the next time it should fetch it from cache. I'll remove that debug msg in release build and also look into that -1 for unlimited.

Kyrobi commented 4 months ago

Every time I open the the /finditem menu again, it prints the message to the console

myzticbean commented 4 months ago

Fixed in 2.0.5.7 release. Reopen if issue persist.