import { world } from "@minecraft/server";
import { HexEncoder } from "./my_API";
export var PlayerDynamicProperty;
(function (PlayerDynamicProperty) {
    PlayerDynamicProperty["CODE1"] = "nps_mot:CodexOreDiscovered1";
})(PlayerDynamicProperty || (PlayerDynamicProperty = {}));
world.afterEvents.playerSpawn.subscribe(event => {
    const player = event.player;
    if (!event.initialSpawn) {
        return;
    }
    ;
    initializePlayerProperties(player);
});
function initializePlayerProperties(player) {
    if (!player.getDynamicProperty(PlayerDynamicProperty.CODE1)) {
        player.setDynamicProperty(PlayerDynamicProperty.CODE1, HexEncoder.encodeFalse(39));
    }
}
function resetPlayerProperties(player) {
    player.setDynamicProperty(PlayerDynamicProperty.CODE1, HexEncoder.encodeFalse(39));
}
