SteamWar/SpigotCore
Archiviert
13
0

Add potential StartUpTime decrease by lazy loading commands only on usage

Dieser Commit ist enthalten in:
yoyosource 2021-10-22 20:09:06 +02:00
Ursprung 8a31be11f5
Commit ef2ab78307

Datei anzeigen

@ -76,8 +76,6 @@ public abstract class SWCommand {
}
private synchronized void createMapping() {
Bukkit.getLogger().log(Level.INFO, () -> "Initializing: " + getClass().getTypeName());
long time = System.currentTimeMillis();
Method[] methods = getClass().getDeclaredMethods();
for (Method method : methods) {
addMapper(Mapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> {
@ -134,7 +132,6 @@ public abstract class SWCommand {
});
commandHelpList.sort(Comparator.comparingInt(o -> -o.subCommand.length));
}
Bukkit.getLogger().log(Level.INFO, () -> "Load time for " + getClass().getTypeName() + " was " + (System.currentTimeMillis() - time) + "ms");
initialized = true;
}