import * as utils from "../../utils/index";
import { WornHat } from "../worn_hat";
class PizzaHat extends WornHat {
    constructor() {
        super(...arguments);
        this.hatTypeId = "ldz_crcomp:hat_pizza";
    }
    async onEquip() {
        const wearer = this.hatWearer.Entity;
        utils.waitForLoopEvent(20, () => {
            if (wearer.isValid()) {
                wearer.addEffect("saturation", 1, { amplifier: 1, showParticles: false });
                wearer.removeEffect("hunger");
            }
            return false;
        }, this.cancelCategory);
    }
    async onUnequip() {
        utils.abortEvents(this.cancelCategory);
    }
}
WornHat.HatTable["ldz_crcomp:hat_pizza"] = PizzaHat;
