GeorgH93 / Minepacks

Free and reliable backpack plugin for Bukkit/Spigot/Paper
https://www.spigotmc.org/resources/19286/
GNU General Public License v3.0
165 stars 75 forks source link

Loading Item name language file freezes server startup #189

Closed TheNety closed 2 years ago

TheNety commented 2 years ago

Information

Environment information Plugin + server version info:


[18:05:34 INFO]: ##### Start Minepacks version info #####
[18:05:34 INFO]: Minepacks: 2.4.3-Release
[18:05:34 INFO]: Server: git-Purpur-"9a7a4dc" (MC: 1.17.1)
[18:05:34 INFO]: Java: 16.0.2
[18:05:34 INFO]: #####  End Minepacks version info  #####

Online mode: no

BungeeCord: no

Server/crash log


[13:47:42] [Server thread/INFO]: [Minepacks] Enabling Minepacks v2.4.3-Release
[13:47:42] [Server thread/INFO]: [Minepacks] Starting Minepacks in standalone mode!
[13:47:42] [Server thread/INFO]: [Minepacks] Config file successfully loaded.
[13:47:42] [Server thread/INFO]: [Minepacks] Language file successfully loaded. Language: english  Author: GeorgH93
[13:47:42] [Server thread/INFO]: [at.pcgamingfreaks.MinepacksStandalone.libs.com.zaxxer.hikari.HikariDataSource] Minepacks-Connection-Pool - Starting...
[13:47:42] [Server thread/INFO]: [at.pcgamingfreaks.MinepacksStandalone.libs.com.zaxxer.hikari.HikariDataSource] Minepacks-Connection-Pool - Start completed.
[13:47:54] [Server thread/INFO]: [Minepacks] Item name language file successfully loaded. Language: english  Author: GeorgH93
[13:47:54] [Server thread/INFO]: [Minepacks] Loading item translations ...
[13:47:54] [Server thread/INFO]: [Minepacks] Finished loading item translations for 828 items.
[13:47:54] [Server thread/INFO]: [Minepacks]  Minepacks has been enabled!  :) 

Details

Description
As you can see in the log, loading of the Minepacks plugin (probably Item name language file) freezes the whole server startup for over 10 seconds. Would it maybe be possible to do it async or something so it doesn't block the main thread?

GeorgH93 commented 2 years ago

It's probably initializing the caches. It only takes about 2 seconds on my system, so I ignored it. Please try if this build improves it for you to an acceptable time.

TheNety commented 2 years ago

With that build, it's done in less than 1 second, wow! Thank you very much. Also realised it's not somehow big issue anyway, I shouldn't be so much perfectionist lol. Appreciate it!