import { ItemStack, EquipmentSlot } from "@minecraft/server";
let nextPage = {
    "kicu_mmad:recipe_book": "kicu_mmad:recipe_10",
    "kicu_mmad:recipe_10": "kicu_mmad:recipe_13",
    "kicu_mmad:recipe_13": "kicu_mmad:recipe_7",
    "kicu_mmad:recipe_7": "kicu_mmad:recipe_3",
    "kicu_mmad:recipe_3": "kicu_mmad:recipe_6",
    "kicu_mmad:recipe_6": "kicu_mmad:recipe_5",
    "kicu_mmad:recipe_5": "kicu_mmad:recipe_4",
    "kicu_mmad:recipe_4": "kicu_mmad:recipe_8",
    "kicu_mmad:recipe_8": "kicu_mmad:recipe_1",
    "kicu_mmad:recipe_1": "kicu_mmad:recipe_9",
    "kicu_mmad:recipe_9": "kicu_mmad:recipe_2",
    "kicu_mmad:recipe_2": "kicu_mmad:recipe_14",
    "kicu_mmad:recipe_14": "kicu_mmad:recipe_15",
    "kicu_mmad:recipe_15": "kicu_mmad:recipe_12",
    "kicu_mmad:recipe_12": "kicu_mmad:recipe_11",
    "kicu_mmad:recipe_11": "kicu_mmad:recipe_16",
    "kicu_mmad:recipe_16": "kicu_mmad:recipe_17",
    "kicu_mmad:recipe_17": "kicu_mmad:recipe_18",
    "kicu_mmad:recipe_18": "kicu_mmad:recipe_19",
    "kicu_mmad:recipe_19": "kicu_mmad:recipe_20",
    "kicu_mmad:recipe_20": "kicu_mmad:recipe_21",
    "kicu_mmad:recipe_21": "kicu_mmad:recipe_22",
    "kicu_mmad:recipe_22": "kicu_mmad:recipe_23",
    "kicu_mmad:recipe_23": "kicu_mmad:recipe_24",
    "kicu_mmad:recipe_24": "kicu_mmad:recipe_book",
};
let lastPage = {
    "kicu_mmad:recipe_book": "kicu_mmad:recipe_book",
    "kicu_mmad:recipe_10": "kicu_mmad:recipe_book",
    "kicu_mmad:recipe_13": "kicu_mmad:recipe_10",
    "kicu_mmad:recipe_7": "kicu_mmad:recipe_13",
    "kicu_mmad:recipe_3": "kicu_mmad:recipe_7",
    "kicu_mmad:recipe_6": "kicu_mmad:recipe_3",
    "kicu_mmad:recipe_5": "kicu_mmad:recipe_6",
    "kicu_mmad:recipe_4": "kicu_mmad:recipe_5",
    "kicu_mmad:recipe_8": "kicu_mmad:recipe_4",
    "kicu_mmad:recipe_1": "kicu_mmad:recipe_8",
    "kicu_mmad:recipe_9": "kicu_mmad:recipe_1",
    "kicu_mmad:recipe_2": "kicu_mmad:recipe_9",
    "kicu_mmad:recipe_14": "kicu_mmad:recipe_2",
    "kicu_mmad:recipe_15": "kicu_mmad:recipe_14",
    "kicu_mmad:recipe_12": "kicu_mmad:recipe_15",
    "kicu_mmad:recipe_11": "kicu_mmad:recipe_12",
    "kicu_mmad:recipe_16": "kicu_mmad:recipe_11",
    "kicu_mmad:recipe_17": "kicu_mmad:recipe_16",
    "kicu_mmad:recipe_18": "kicu_mmad:recipe_17",
    "kicu_mmad:recipe_19": "kicu_mmad:recipe_18",
    "kicu_mmad:recipe_20": "kicu_mmad:recipe_19",
    "kicu_mmad:recipe_21": "kicu_mmad:recipe_20",
    "kicu_mmad:recipe_22": "kicu_mmad:recipe_21",
    "kicu_mmad:recipe_23": "kicu_mmad:recipe_22",
    "kicu_mmad:recipe_24": "kicu_mmad:recipe_23",
};
export function changePage(log, itemStack, sourceEntity) {
    const equipment = sourceEntity.getComponent("minecraft:equippable");
    const pageId = !sourceEntity.isSneaking ? nextPage[itemStack.typeId] : lastPage[itemStack.typeId];
    if (pageId !== itemStack.typeId) {
        const item = new ItemStack(pageId, 1);
        equipment.setEquipment(EquipmentSlot.Mainhand, item);
        sourceEntity.playSound("sound.kicu_mmad_book_pages.change");
        sourceEntity.onScreenDisplay.setActionBar({
            rawtext: [{ translate: "item." + pageId + ".name", with: ["\n"] }],
        });
    }
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/C/CraftingBook.js.map
