Hooks.on("ready", async function() {
        game.settings.register("dmdave-chain-devil-crypts", "imported-140", {
                scope: "world",
                config: false,
                type: Boolean,
                default: false
        });
        game.settings.register("dmdave-chain-devil-crypts", "imported-template-adventure-1.0.0", {
                scope: "world",
                config: false,
                type: Boolean,
                default: false
        });

        game.settings.register("dmdave-chain-devil-crypts", "base-system-version", {
                scope: "world",
                config: false,
                type: String,
                default: false
        });
        const module = game.modules.get("dmdave-chain-devil-crypts");
        if (game.user.isGM && isNewerVersion(game.system.data.version,game.settings.get("dmdave-chain-devil-crypts", "base-system-version"))) {      
                for (let p of module.packs) {
                        if (p.system !== game.system.id && p.system) continue;
                        if (p.system === "dnd5e") {
                                await game.dnd5e.migrations.migrateCompendium(await game.packs.get(`${p.package}.${p.name}`));
                        }
                }
                game.settings.set("dmdave-chain-devil-crypts", "base-system-version",game.system.data.version);
        }
        if (!game.settings.get("dmdave-chain-devil-crypts", "imported-template-adventure-1.0.0")) {
                if (game.user.isGM) {      
                      (await import(
                              /* webpackChunkName: "welcome-screen" */
                              './welcome-screen.js'
                              )
                      ).default();
                }
        }
})

