Also clear ClassInfo cache after server starts

This commit is contained in:
embeddedt 2023-04-18 22:17:32 -04:00
parent e5028535e9
commit 74c3f0ff90
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 6 additions and 1 deletions

View File

@ -105,6 +105,7 @@ public class ModernFix {
float gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f; float gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load"); ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load");
} }
ClassInfoManager.clear();
} }
@SubscribeEvent(priority = EventPriority.LOWEST) @SubscribeEvent(priority = EventPriority.LOWEST)

View File

@ -19,6 +19,10 @@ public class ClassInfoManager {
return; return;
} }
} }
classInfoCache.entrySet().removeIf(entry -> !entry.getKey().equals("java/lang/Object")); try {
classInfoCache.entrySet().removeIf(entry -> !entry.getKey().equals("java/lang/Object"));
} catch(RuntimeException e) {
e.printStackTrace();
}
} }
} }