import { Direction, ItemStack, system } from "@minecraft/server";
import { amountToDropWithFortune, damageItemStack, getFortuneLevel, getRandomInt, getSilkTouchLevel, getUnbreakableVanillaBlocksIds, getWouldNotWantToBreak } from "nps_tbe/others/my_API";
export function getItemTags(itemStack) {
    const vanillaPickaxeTags = Object.freeze({
        "minecraft:wooden_pickaxe": ["nps_tbe:wood_pick_diggable"],
        "minecraft:stone_pickaxe": ["nps_tbe:stone_pick_diggable"],
        "minecraft:golden_pickaxe": ["nps_tbe:stone_pick_diggable"],
        "minecraft:iron_pickaxe": ["nps_tbe:iron_pick_diggable"],
        "minecraft:diamond_pickaxe": ["nps_tbe:diamond_pick_diggable"],
        "minecraft:netherite_pickaxe": ["nps_tbe:diamond_pick_diggable"]
    });
    const pickaxeTags = [
        ...(vanillaPickaxeTags[itemStack.typeId] || []),
        ...(itemStack.getTags() || [])
    ].filter(tags => tags && tags.length > 0);
    return pickaxeTags;
}
export function getBlockTags(block) {
    const vanillaOreTags = {
        "minecraft:stone": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:coal_ore": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_coal_ore": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:quartz_ore": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:nether_gold_ore": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        //
        "minecraft:copper_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_copper_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:raw_copper_block": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:lapis_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_lapis_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:iron_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_iron_ore": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:raw_iron_block": ["nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        //
        "minecraft:gold_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_gold_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:raw_gold_block": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:diamond_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_diamond_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:emerald_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_emerald_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:redstone_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:deepslate_redstone_ore": ["nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        //
        "minecraft:ancient_debris": ["nps_tbe:diamond_pick_diggable"],
    };
    const blockTags = [
        ...(vanillaOreTags[block.typeId] || []),
        ...(block.getTags() || [])
    ].filter(tags => tags && tags.length > 0);
    return blockTags;
}
export function hasMatchingTag(blockTags, pickaxeTags) {
    if (blockTags === undefined) {
        return false;
    }
    if (pickaxeTags === undefined) {
        return false;
    }
    for (const blockTag of blockTags) {
        if (pickaxeTags.includes(blockTag)) {
            return true;
        }
    }
    return false;
}
export function getPickaxeTags(itemStack) {
    const vanillaPickaxeTags = Object.freeze({
        "minecraft:wooden_pickaxe": ["nps_tbe:wood_pick_diggable"],
        "minecraft:stone_pickaxe": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable"],
        "minecraft:golden_pickaxe": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable"],
        "minecraft:iron_pickaxe": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable"],
        "minecraft:diamond_pickaxe": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"],
        "minecraft:netherite_pickaxe": ["nps_tbe:wood_pick_diggable", "nps_tbe:stone_pick_diggable", "nps_tbe:iron_pick_diggable", "nps_tbe:diamond_pick_diggable"]
    });
    const pickaxeTags = [
        ...(vanillaPickaxeTags[itemStack.typeId] || []),
        ...(itemStack.getTags() || [])
    ].filter(tags => tags && tags.length > 0);
    return pickaxeTags;
}
export function getSquareShapedBlocks(event, squareSize = 1) {
    const player = event.player;
    const block = event.block;
    const blockFromViewDirection = player.getBlockFromViewDirection();
    let face = undefined;
    if (blockFromViewDirection !== undefined) {
        face = blockFromViewDirection.face;
    }
    let blocksToBreak = [];
    switch (face) {
        case Direction.Down:
        case Direction.Up: {
            //x,z
            for (let x = -squareSize; x <= squareSize; x++) {
                for (let z = -squareSize; z <= squareSize; z++) {
                    //if(x == 0 && z == 0){continue;}
                    const blockToCheck = player.dimension.getBlock({
                        x: block.x + x,
                        y: block.y,
                        z: block.z + z
                    });
                    blocksToBreak.push(blockToCheck);
                }
            }
            break;
        }
        case Direction.East:
        case Direction.West: {
            //z,y
            for (let z = -squareSize; z <= squareSize; z++) {
                for (let y = -squareSize; y <= squareSize; y++) {
                    //if(y == 0 && z == 0){continue;}
                    if ((block.y + y) < block.dimension.heightRange.min || (block.y + y) > block.dimension.heightRange.max) {
                        continue;
                    }
                    const blockToCheck = player.dimension.getBlock({
                        x: block.x,
                        y: block.y + y,
                        z: block.z + z
                    });
                    blocksToBreak.push(blockToCheck);
                }
            }
            break;
        }
        case Direction.North:
        case Direction.South: {
            //x,y
            for (let x = -squareSize; x <= squareSize; x++) {
                for (let y = -squareSize; y <= squareSize; y++) {
                    //if(x == 0 && y == 0){continue;}
                    if ((block.y + y) < block.dimension.heightRange.min || (block.y + y) > block.dimension.heightRange.max) {
                        continue;
                    }
                    const blockToCheck = player.dimension.getBlock({
                        x: block.x + x,
                        y: block.y + y,
                        z: block.z
                    });
                    blocksToBreak.push(blockToCheck);
                }
            }
            break;
        }
    }
    return blocksToBreak;
}
export function onHammerMining(event) {
    const itemStack = event.itemStack;
    const player = event.player;
    const block = event.block;
    const exclusionBlockIds = [
        "minecraft:torch",
        "minecraft:redstone_torch",
        "minecraft:soul_torch"
    ];
    if (exclusionBlockIds.includes(block.typeId)) {
        return;
    }
    let canBreakBlocks = false;
    const oreLootIndex = OreLootCollection.findOreIndexByOreId(block.typeId);
    if (oreLootIndex != -1) {
        //TBE block
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            canBreakBlocks = true;
        }
        else {
            event.cancel = true;
            system.run(() => {
                block.setType("air");
            });
        }
    }
    const vanillaOreLootIndex = OreLootCollection.findVanillaOreIndexByOreId(block.typeId);
    if (vanillaOreLootIndex != -1) {
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            canBreakBlocks = true;
        }
        else {
            event.cancel = true;
            system.run(() => {
                block.setType("air");
            });
        }
    }
    if (vanillaOreLootIndex == -1 && oreLootIndex == -1) {
        //vanilla block
        canBreakBlocks = true;
    }
    if (!canBreakBlocks) {
        //damageTool
        system.run(() => {
            damageItemStack(player);
        });
        return;
    }
    const blocksToBreak = getSquareShapedBlocks(event);
    const damage = 1 + breakBlocks(event, blocksToBreak, itemStack, player);
    system.run(() => {
        damageItemStack(player, damage);
    });
}
export function breakBlocks(event, blocks, itemStack, player) {
    let brokenBlock = 0;
    for (let i = 0; i < blocks.length; i++) {
        brokenBlock += breakBlock(event, blocks[i], itemStack, player);
    }
    return brokenBlock;
}
export function breakBlock(event, block, itemStack, player) {
    if (getUnbreakableVanillaBlocksIds().includes(block.typeId)) {
        return 0;
    }
    if (getWouldNotWantToBreak().includes(block.typeId)) {
        return 0;
    }
    const oreLootIndex = OreLootCollection.findOreIndexByOreId(block.typeId);
    const vanillaOreLootIndex = OreLootCollection.findVanillaOreIndexByOreId(block.typeId);
    if (oreLootIndex == -1 && vanillaOreLootIndex == -1) {
        //vanilla block
        system.run(() => {
            block.dimension.runCommand(`/setblock ${block.x} ${block.y} ${block.z} air destroy`);
        });
        return 1;
    }
    if (vanillaOreLootIndex != -1) {
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            event.cancel = true;
            const location = block.bottomCenter();
            OreLootCollection.vanillaOres[vanillaOreLootIndex].dropLoot({
                dimension: block.dimension,
                x: location.x,
                y: location.y,
                z: location.z
            }, itemStack, false);
            system.run(() => {
                block.setType("air");
            });
            return 1;
        }
        else {
            return 0;
        }
    }
    if (oreLootIndex != -1) {
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            event.cancel = true;
            const location = block.bottomCenter();
            OreLootCollection.ores[oreLootIndex].dropLoot({
                dimension: block.dimension,
                x: location.x,
                y: location.y,
                z: location.z
            }, itemStack, false);
            system.run(() => {
                block.setType("air");
            });
            return 1;
        }
        else {
            return 0;
        }
    }
}
export function onPickaxeMining(event) {
    const itemStack = event.itemStack;
    const player = event.player;
    const block = event.block;
    //check if block is valid
    let canBreakBlocks = false;
    const oreLootIndex = OreLootCollection.findOreIndexByOreId(block.typeId);
    if (oreLootIndex != -1) {
        //TBE block
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            canBreakBlocks = true;
        }
        else {
            event.cancel = true;
            system.run(() => {
                block.setType("air");
            });
        }
    }
    const vanillaOreLootIndex = OreLootCollection.findVanillaOreIndexByOreId(block.typeId);
    if (vanillaOreLootIndex != -1) {
        //vanilla MOT
        const pickaxeTags = getPickaxeTags(itemStack);
        const blockTags = getBlockTags(block);
        const hasTag = hasMatchingTag(blockTags, pickaxeTags);
        if (hasTag) {
            canBreakBlocks = true;
        }
        else {
            event.cancel = true;
            system.run(() => {
                block.setType("air");
            });
        }
    }
    if (vanillaOreLootIndex == -1 && oreLootIndex == -1) {
        //vanilla block
        canBreakBlocks = true;
    }
    if (!canBreakBlocks) {
        //damageTool
        system.run(() => {
            damageItemStack(player);
        });
        return;
    }
    const blocksToBreak = [event.block];
    const damage = breakBlocks(event, blocksToBreak, itemStack, player);
    system.run(() => {
        damageItemStack(player, damage);
    });
}
export class Pickaxe {
    constructor(typeId, pickDiggableTags) {
        this.typeId = typeId;
        this.pickDiggableTags = pickDiggableTags;
    }
}
export class OreLoot {
    constructor(typeId, oreDrop, smeltedOre, itemDropAmount, experienceAmount, fortuneBoostEnabled, maximumDropAmount) {
        this.typeId = typeId;
        this.oreDrop = oreDrop;
        this.smeltedOre = smeltedOre;
        this.itemDropAmount = itemDropAmount;
        this.experienceAmount = experienceAmount;
        this.fortuneBoostEnabled = fortuneBoostEnabled;
        this.maximumDropAmount = maximumDropAmount;
    }
    dropLoot(dimensionLocation, itemStack, isTriggering = false) {
        system.run(() => {
            const silktouchLevel = getSilkTouchLevel(itemStack);
            if (silktouchLevel > 0) {
                if (isTriggering) {
                    return;
                }
                dimensionLocation.dimension.spawnItem(new ItemStack(this.typeId), dimensionLocation);
                return;
            }
            else {
                // Apply fortune level
                const fortuneLevel = getFortuneLevel(itemStack);
                let amount = getRandomInt(this.itemDropAmount[0], this.itemDropAmount[1]);
                if (this.fortuneBoostEnabled && fortuneLevel > 0) {
                    amount = amountToDropWithFortune(fortuneLevel, amount);
                    amount = Math.min(amount, this.maximumDropAmount);
                }
                // Spawn the item
                const itemType = this.oreDrop.typeId;
                dimensionLocation.dimension.spawnItem(new ItemStack(itemType, amount), dimensionLocation);
                // Spawn experience orbs
                const experienceAmount = getRandomInt(this.experienceAmount[0], this.experienceAmount[1]);
                for (let i = 0; i < experienceAmount; i++) {
                    dimensionLocation.dimension.spawnEntity("minecraft:xp_orb", dimensionLocation);
                }
            }
        });
    }
    getLootType() {
        return undefined;
    }
    getOreDropTranslateText() {
        const lootType = this.getLootType();
        let oreTypeId = this.oreDrop.typeId;
        if (oreTypeId.includes('minecraft:')) {
            switch (lootType) {
                case "item": {
                    return `item.${oreTypeId.split('minecraft:')[1]}.name`;
                }
                case "tile": {
                    return `tile.${oreTypeId.split('minecraft:')[1]}.name`;
                }
                default: {
                    return undefined;
                }
            }
        }
        else {
            switch (lootType) {
                case "item": {
                    return `item.${oreTypeId}`;
                }
                case "tile": {
                    return `tile.${oreTypeId}.name`;
                }
                default: {
                    return undefined;
                }
            }
        }
    }
    getOreTranslateText() {
        let typeId = this.typeId;
        if (typeId.includes('minecraft:')) {
            typeId = typeId.split('minecraft:')[1];
        }
        return `tile.${typeId}.name`;
    }
}
class GemOre extends OreLoot {
    constructor(typeId, oreDrop, itemDropAmount = [1, 1], experienceAmount = [1, 1], fortuneBoostEnabled = true, maximumDropAmount = undefined) {
        if (maximumDropAmount === undefined) {
            if (fortuneBoostEnabled == true) {
                maximumDropAmount = itemDropAmount[1] * 4;
            }
            else {
                maximumDropAmount = itemDropAmount[1];
            }
        }
        super(typeId, oreDrop, oreDrop, itemDropAmount, experienceAmount, fortuneBoostEnabled, maximumDropAmount);
    }
    getLootType() {
        return "item";
    }
}
class VoidOre extends OreLoot {
    constructor(typeId) {
        super(typeId, undefined, undefined, [0, 0], [0, 0], false, 0);
    }
    getLootType() {
        return undefined;
    }
}
class RawOre extends OreLoot {
    constructor(typeId, oreDrop, smeltedOre, itemDropAmount = [1, 1], experienceAmount = [1, 1], fortuneBoostEnabled = false, maximumDropAmount = undefined) {
        if (maximumDropAmount === undefined) {
            if (fortuneBoostEnabled == true) {
                maximumDropAmount = itemDropAmount[1] * 4;
            }
            else {
                maximumDropAmount = itemDropAmount[1];
            }
        }
        super(typeId, oreDrop, smeltedOre, itemDropAmount, experienceAmount, fortuneBoostEnabled, maximumDropAmount);
    }
    getLootType() {
        return "item";
    }
}
class ConstructionBlock extends OreLoot {
    constructor(typeId, smeltedOre) {
        if (smeltedOre == undefined) {
            super(typeId, new ItemStack(typeId), new ItemStack(typeId), [1, 1], [0, 0], false, 1);
        }
        else {
            super(typeId, new ItemStack(typeId), smeltedOre, [1, 1], [0, 0], false, 1);
        }
    }
    getLootType() {
        return "tile";
    }
}
export class OreLootCollection {
    static findOreIndexByOreId(oreId) {
        return this.ores.findIndex((ore) => ore.typeId === oreId);
    }
    static findVanillaOreIndexByOreId(oreId) {
        return this.vanillaOres.findIndex((ore) => ore.typeId === oreId);
    }
    static findOreIndexByOreDrop(oreDropId) {
        return this.ores.findIndex((ore) => ore.oreDrop.typeId === oreDropId);
    }
}
OreLootCollection.ores = [
    new VoidOre(`nps_tbe:altar_base`),
    new VoidOre(`nps_tbe:altar_pedestal`),
    //
    new VoidOre(`nps_tbe:travel_stone_0`),
    new VoidOre(`nps_tbe:travel_stone_1`),
    new VoidOre(`nps_tbe:travel_stone_2`),
    //
    new GemOre(`nps_tbe:aether_quartz_ore_0`, new ItemStack(`nps_tbe:aether_quartz`), [1, 3], [10, 20], true, 6),
    new GemOre(`nps_tbe:aether_quartz_ore_1`, new ItemStack(`nps_tbe:aether_quartz`), [1, 3], [10, 20], true, 6),
    new GemOre(`nps_tbe:aether_quartz_ore_2`, new ItemStack(`nps_tbe:aether_quartz`), [1, 3], [10, 20], true, 6),
    new GemOre(`nps_tbe:aether_quartz_ore_3`, new ItemStack(`nps_tbe:aether_quartz`), [1, 3], [10, 20], true, 6),
    new GemOre(`nps_tbe:aether_quartz_ore_4`, new ItemStack(`nps_tbe:aether_quartz`), [1, 3], [10, 20], true, 6),
    new GemOre(`nps_tbe:voidium_ore_0`, new ItemStack(`nps_tbe:voidium_shard`), [1, 2], [1, 5], true, 6),
    new GemOre(`nps_tbe:voidium_ore_1`, new ItemStack(`nps_tbe:voidium_shard`), [1, 2], [1, 5], true, 6),
    new GemOre(`nps_tbe:voidium_ore_2`, new ItemStack(`nps_tbe:voidium_shard`), [1, 2], [1, 5], true, 6),
    new GemOre(`nps_tbe:voidium_ore_3`, new ItemStack(`nps_tbe:voidium_shard`), [1, 2], [1, 5], true, 6),
    new GemOre(`nps_tbe:voidium_ore_4`, new ItemStack(`nps_tbe:voidium_shard`), [1, 2], [1, 5], true, 6),
    new RawOre(`nps_tbe:stellar_iron_ore_0`, new ItemStack(`nps_tbe:raw_stellar_iron`), new ItemStack(`nps_tbe:raw_stellar_iron`), [2, 4], [0, 0], false, 4),
    new RawOre(`nps_tbe:stellar_iron_ore_1`, new ItemStack(`nps_tbe:raw_stellar_iron`), new ItemStack(`nps_tbe:raw_stellar_iron`), [2, 4], [0, 0], false, 4),
    new RawOre(`nps_tbe:stellar_iron_ore_2`, new ItemStack(`nps_tbe:raw_stellar_iron`), new ItemStack(`nps_tbe:raw_stellar_iron`), [2, 4], [0, 0], false, 4),
    new RawOre(`nps_tbe:stellar_iron_ore_3`, new ItemStack(`nps_tbe:raw_stellar_iron`), new ItemStack(`nps_tbe:raw_stellar_iron`), [2, 4], [0, 0], false, 4),
    new RawOre(`nps_tbe:stellar_iron_ore_4`, new ItemStack(`nps_tbe:raw_stellar_iron`), new ItemStack(`nps_tbe:raw_stellar_iron`), [2, 4], [0, 0], false, 4),
    new RawOre(`nps_tbe:celestium_ore_0`, new ItemStack(`nps_tbe:raw_celestium`), new ItemStack(`nps_tbe:raw_celestium`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:celestium_ore_1`, new ItemStack(`nps_tbe:raw_celestium`), new ItemStack(`nps_tbe:raw_celestium`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:celestium_ore_2`, new ItemStack(`nps_tbe:raw_celestium`), new ItemStack(`nps_tbe:raw_celestium`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:celestium_ore_3`, new ItemStack(`nps_tbe:raw_celestium`), new ItemStack(`nps_tbe:raw_celestium`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:celestium_ore_4`, new ItemStack(`nps_tbe:raw_celestium`), new ItemStack(`nps_tbe:raw_celestium`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:enderite_ore_0`, new ItemStack(`nps_tbe:raw_enderite`), new ItemStack(`nps_tbe:raw_enderite`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:enderite_ore_1`, new ItemStack(`nps_tbe:raw_enderite`), new ItemStack(`nps_tbe:raw_enderite`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:enderite_ore_2`, new ItemStack(`nps_tbe:raw_enderite`), new ItemStack(`nps_tbe:raw_enderite`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:enderite_ore_3`, new ItemStack(`nps_tbe:raw_enderite`), new ItemStack(`nps_tbe:raw_enderite`), [1, 2], [0, 0], false, 2),
    new RawOre(`nps_tbe:enderite_ore_4`, new ItemStack(`nps_tbe:raw_enderite`), new ItemStack(`nps_tbe:raw_enderite`), [1, 2], [0, 0], false, 2),
    //
    new ConstructionBlock(`nps_tbe:aether_quartz_block`),
    new ConstructionBlock(`nps_tbe:voidium_block`),
    new ConstructionBlock(`nps_tbe:stellar_iron_block`),
    new ConstructionBlock(`nps_tbe:celestium_block`),
    new ConstructionBlock(`nps_tbe:enderite_block`),
    //
    new ConstructionBlock(`nps_tbe:raw_stellar_iron_block`),
    new ConstructionBlock(`nps_tbe:raw_celestium_block`),
    new ConstructionBlock(`nps_tbe:raw_enderite_block`),
];
OreLootCollection.vanillaOres = [
    new RawOre(`minecraft:stone`, new ItemStack(`minecraft:cobblestone`), new ItemStack(`minecraft:stone`), [1, 1], [0, 0]),
    new GemOre(`minecraft:coal_ore`, new ItemStack(`minecraft:coal`)),
    new GemOre(`minecraft:deepslate_coal_ore`, new ItemStack(`minecraft:coal`)),
    new GemOre(`minecraft:lapis_ore`, new ItemStack(`minecraft:lapis_lazuli`), [4, 9], [1, 3]),
    new GemOre(`minecraft:deepslate_lapis_ore`, new ItemStack(`minecraft:lapis_lazuli`), [4, 9], [1, 3]),
    new RawOre(`minecraft:iron_ore`, new ItemStack(`minecraft:raw_iron`), new ItemStack(`minecraft:iron_ingot`), [1, 1], [0, 0], true),
    new RawOre(`minecraft:deepslate_iron_ore`, new ItemStack(`minecraft:raw_iron`), new ItemStack(`minecraft:iron_ingot`), [1, 1], [0, 0], true),
    new RawOre(`minecraft:gold_ore`, new ItemStack(`minecraft:raw_gold`), new ItemStack(`minecraft:gold_ingot`), [1, 1], [0, 0], true),
    new RawOre(`minecraft:deepslate_gold_ore`, new ItemStack(`minecraft:raw_gold`), new ItemStack(`minecraft:gold_ingot`), [1, 1], [0, 0], true),
    new RawOre(`minecraft:nether_gold_ore`, new ItemStack(`minecraft:gold_nugget`), new ItemStack(`minecraft:gold_nugget`), [2, 6], [0, 0], true),
    new GemOre(`minecraft:redstone_ore`, new ItemStack(`minecraft:redstone`), [4, 5], [1, 3,], true, 8),
    new GemOre(`minecraft:deepslate_redstone_ore`, new ItemStack(`minecraft:redstone`), [4, 5], [1, 3,], true, 8),
    new GemOre(`minecraft:diamond_ore`, new ItemStack(`minecraft:diamond`), [1, 1], [1, 3]),
    new GemOre(`minecraft:deepslate_diamond_ore`, new ItemStack(`minecraft:diamond`), [1, 1], [1, 3]),
    new GemOre(`minecraft:emerald_ore`, new ItemStack(`minecraft:emerald`), [1, 1], [1, 3]),
    new GemOre(`minecraft:deepslate_emerald_ore`, new ItemStack(`minecraft:emerald`), [1, 1], [1, 3]),
    new RawOre(`minecraft:copper_ore`, new ItemStack(`minecraft:raw_copper`), new ItemStack(`minecraft:copper_ingot`), [2, 5], [0, 0], true),
    new RawOre(`minecraft:deepslate_copper_ore`, new ItemStack(`minecraft:raw_copper`), new ItemStack(`minecraft:copper_ingot`), [2, 5], [0, 0], true),
    new GemOre(`minecraft:quartz_ore`, new ItemStack(`minecraft:quartz`), [1, 1], [2, 5]),
    new ConstructionBlock(`minecraft:ancient_debris`, new ItemStack(`minecraft:netherite_scrap`)),
    new ConstructionBlock(`minecraft:raw_copper_block`, new ItemStack('minecraft:copper_block')),
    new ConstructionBlock(`minecraft:raw_iron_block`, new ItemStack('minecraft:iron_block')),
    new ConstructionBlock(`minecraft:raw_gold_block`, new ItemStack('minecraft:gold_block'))
];
