/*
 * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
 *
 * Copyright (c) 2015 - 2025 CCBlueX
 *
 * LiquidBounce is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * LiquidBounce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
 */
package net.ccbluex.liquidbounce.features.itemgroup.groups

import net.ccbluex.liquidbounce.features.itemgroup.ClientItemGroup
import net.ccbluex.liquidbounce.utils.item.createSplashPotion
import net.ccbluex.liquidbounce.utils.kotlin.mapArray
import net.ccbluex.liquidbounce.utils.kotlin.toTypedArray
import net.minecraft.block.Blocks
import net.minecraft.entity.effect.StatusEffectInstance
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.registry.Registries

class ExploitsItemGroup : ClientItemGroup(
    "Exploits",
    icon = { ItemStack(Items.LINGERING_POTION) },
    items = {
        // Add unobtainable items
        it.add(ItemStack(Blocks.COMMAND_BLOCK))
        it.add(ItemStack(Blocks.CHAIN_COMMAND_BLOCK))
        it.add(ItemStack(Blocks.REPEATING_COMMAND_BLOCK))
        it.add(ItemStack(Items.COMMAND_BLOCK_MINECART))
        it.add(ItemStack(Blocks.END_PORTAL_FRAME))
        it.add(ItemStack(Blocks.DRAGON_EGG))
        it.add(ItemStack(Blocks.BARRIER))
        it.add(ItemStack(Blocks.JIGSAW))
        it.add(ItemStack(Blocks.STRUCTURE_BLOCK))
        it.add(ItemStack(Blocks.STRUCTURE_VOID))
        it.add(ItemStack(Blocks.SPAWNER))
        it.add(ItemStack(Items.DEBUG_STICK))

        // Add unobtainable potions
        it.add(createSplashPotion("Troll Potion",
            effects = Registries.STATUS_EFFECT.streamEntries().toTypedArray().mapArray { statusEffect ->
                StatusEffectInstance(statusEffect, Int.MAX_VALUE, 127)
            }))

        it.add(createSplashPotion("Kill Potion",
            StatusEffectInstance(StatusEffects.INSTANT_HEALTH, 0, 125),
            StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 0, 125)
        ))

    }
)
