/*
 *   This file is a part of the SteamWar software.
 *
 *   Copyright (C) 2025 SteamWar.de-Serverteam
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Affero General Public License for more details.
 *
 *   You should have received a copy of the GNU Affero General Public License
 *   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package de.steamwar.fightsystem.utils;

import de.steamwar.Reflection;
import de.steamwar.core.VersionDependent;
import de.steamwar.fightsystem.FightSystem;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

public interface BlockIdWrapper {
    Class<?> worldServer = Reflection.getClass("net.minecraft.server.level.ServerLevel");
    Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle", worldServer);

    Class<?> craftPlayer = Reflection.getClass("org.bukkit.craftbukkit.entity.CraftPlayer");
    Class<?> entityPlayer = Reflection.getClass("net.minecraft.server.level.ServerPlayer");
    Reflection.Method getPlayer = Reflection.getTypedMethod(craftPlayer, "getHandle", entityPlayer);

    BlockIdWrapper impl = VersionDependent.getVersionImpl(FightSystem.getPlugin());

    Material idToMaterial(int blockState);
    int blockToId(Block block);
    void setBlock(World world, int x, int y, int z, int blockState);

    void trackEntity(Player player, Entity entity);
    void untrackEntity(Player player, Entity entity);
}
