"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OldCoresBackwardsCompat = void 0;
const EventHandler_1 = require("modloader64_api/EventHandler");
class OldCoresBackwardsCompat {
    inject() {
        EventHandler_1.bus.on('PLUGIN_CONSIDERATION', (meta) => {
            if (Array.isArray(meta.core)) {
                for (let i = 0; i < meta.core.length; i++) {
                    if (meta.core[i] === "OcarinaofTime" || meta.core[i] === "MajorasMask") {
                        console.log(`[Z64O Backwards Compat]: Transforming core requirement for plugin ${meta.name}. ${meta.core[i]} -> Z64Lib`);
                        meta.core[i] = "Z64Lib";
                    }
                }
            }
            else {
                if (meta.core === "OcarinaofTime")
                    meta.core = "Z64Lib";
                if (meta.core === "MajorasMask")
                    meta.core = "Z64Lib";
            }
        });
    }
}
exports.OldCoresBackwardsCompat = OldCoresBackwardsCompat;
//# sourceMappingURL=BackwardsCompat.js.map