Search in sources :

Example 1 with ClientConfig

use of hellfirepvp.astralsorcery.client.data.config.ClientConfig in project AstralSorcery by HellFirePvP.

the class ClientProxy method initialize.

@Override
public void initialize() {
    this.clientScheduler = new ClientScheduler();
    if (!AstralSorcery.isDoingDataGeneration()) {
        IReloadableResourceManager resMgr = (IReloadableResourceManager) Minecraft.getInstance().getResourceManager();
        resMgr.addReloadListener(AssetLibrary.INSTANCE);
        resMgr.addReloadListener(AssetPreLoader.INSTANCE);
        resMgr.addReloadListener(ColorizationHelper.onReload());
        resMgr.addReloadListener((stage, resourceManager, preparationsProfiler, reloadProfiler, backgroundExecutor, gameExecutor) -> stage.markCompleteAwaitingOthers(Unit.INSTANCE).thenRunAsync(() -> {
            if (!SelectiveReloadStateHandler.INSTANCE.get().test(VanillaResourceType.LANGUAGES)) {
                return;
            }
            PerkTree.PERK_TREE.getPerkPoints(LogicalSide.CLIENT).stream().map(PerkTreePoint::getPerk).forEach(AbstractPerk::clearClientTextCaches);
        }));
    }
    this.clientConfig = new ClientConfig();
    super.initialize();
    this.addTomeBookmarks();
    RandomWordGenerator.init();
    this.clientConfig.buildConfiguration();
}
Also used : PerkTreePoint(hellfirepvp.astralsorcery.common.perk.tree.PerkTreePoint) IReloadableResourceManager(net.minecraft.resources.IReloadableResourceManager) ClientConfig(hellfirepvp.astralsorcery.client.data.config.ClientConfig)

Aggregations

ClientConfig (hellfirepvp.astralsorcery.client.data.config.ClientConfig)1 PerkTreePoint (hellfirepvp.astralsorcery.common.perk.tree.PerkTreePoint)1 IReloadableResourceManager (net.minecraft.resources.IReloadableResourceManager)1