EpicEricEE / ShopChest

ShopChest - Spigot/Bukkit Plugin
MIT License
45 stars 57 forks source link

Too many shops when the server starts crashes paper #296

Closed jere62smi closed 4 years ago

jere62smi commented 4 years ago

Hello, Having many shops on my server, when launching the server, the shops seem to want to load all at once or the method is not good for servers with many shops to load, it would require loads per package of 100 for example. Here is the error that I put paper. This problem seems to have been present for 3 years, it might be time to fix it and resume some activity with this plugin... http://bin.mc-imperia.fr/rEmY84zaet

EpicEricEE commented 4 years ago

The problem is that the plugin loads all shops on server start, which includes checking whether there is a chest and space above the chest. For that check to be done, the chunk where the shop is in has to be loaded. When there are a lot of shops spread across the world, many chunks are being loaded at once which probably crashes the server.

I would have to make quite a few changes to improve this, that I currently do not have enough time for.

jere62smi commented 4 years ago

Hmm I see, if I ever manage to make this modification, tested and approved, would you be interested in officially putting it in the plugin?

EpicEricEE commented 4 years ago

If it works and matches style-wise, sure. I may also be trying to come up with some changes.

EpicEricEE commented 4 years ago

Should be fixed with build 83. Leave a message if that is not the case.

jere62smi commented 4 years ago

Hello, I tested and got this error, it doesn't seem to work but may still seem to load faster. http://bin.mc-imperia.fr/Nno9uJvEAj

EpicEricEE commented 4 years ago

Can you try this version below? I could think of one more potential fix ShopChest-1.13-SNAPSHOT.zip

jere62smi commented 4 years ago

Good news, I no longer had any crash paper messages, I had more than 3600 shops to load and it seems to have worked without bringing any lags! Thank you for this optimization.

EpicEricEE commented 4 years ago

Awesome, closing with 26025ef