import * as mc from "@minecraft/server";
import * as utils from "../utils/index";
import { Achievement } from "./achievement";
export class HolidayAchievement extends Achievement {
    constructor() {
        super(...arguments);
        this.SkinIndex = 8;
    }
    onSetup() {
        mc.world.afterEvents.playerSpawn.subscribe(this.onSpawn.bind(this));
        utils.getAllPlayersSafe().forEach(this.checkDate.bind(this));
    }
    onSpawn(event) {
        this.checkDate(new utils.SafetyCheckedPlayer(event.player));
    }
    checkDate(player) {
        const month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
        const date = new Date();
        utils.mclog(`Month: ${month[date.getMonth()]}`);
        if (date.getMonth() === 11) {
            utils.waitForEvent(600, () => this.setStatus(player, true));
        }
    }
}
new HolidayAchievement();
