/*
 *   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.bausystem.features.slaves.laufbau.boundingboxes;

import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Stairs;

import java.util.ArrayList;
import java.util.List;

import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;

@Linked
public class StairBoundingBox implements BoundingBoxLoader {

    @Override
    public void load() {
        straightBottomNorthStair();
        straightBottomSouthStair();
        straightBottomEastStair();
        straightBottomWestStair();

        straightTopNorthStair();
        straightTopSouthStair();
        straightTopEastStair();
        straightTopWestStair();

        outerLeftBottomNorthStair();
        outerLeftBottomSouthStair();
        outerLeftBottomEastStair();
        outerLeftBottomWestStair();

        outerLeftTopNorthStair();
        outerLeftTopSouthStair();
        outerLeftTopEastStair();
        outerLeftTopWestStair();

        innerLeftBottomNorthStair();
        innerLeftBottomSouthStair();
        innerLeftBottomEastStair();
        innerLeftBottomWestStair();

        innerLeftTopNorthStair();
        innerLeftTopSouthStair();
        innerLeftTopEastStair();
        innerLeftTopWestStair();
    }

    public void straightBottomNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_NORTH"));
    }

    public void straightBottomSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 8, 16, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_SOUTH"));
    }

    public void straightBottomEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 8, 0, 8, 8, 16));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_EAST"));
    }

    public void straightBottomWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 0, 8, 8, 16));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_WEST"));
    }

    public void straightTopNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_NORTH"));
    }

    public void straightTopSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 8, 16, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_SOUTH"));
    }

    public void straightTopEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 0, 0, 8, 8, 16));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_EAST"));
    }

    public void straightTopWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.STRAIGHT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 0, 8, 8, 16));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_STRAIGHT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_WEST"));
    }

    public void outerLeftBottomNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_NORTH"));
    }

    public void outerLeftBottomSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 8, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_SOUTH"));
    }

    public void outerLeftBottomEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 8, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_EAST"));
    }

    public void outerLeftBottomWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_WEST"));
    }

    public void outerLeftTopNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_NORTH"));
    }

    public void outerLeftTopSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 0, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_SOUTH"));
    }

    public void outerLeftTopEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(8, 0, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_EAST"));
    }

    public void outerLeftTopWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.OUTER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_OUTER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_WEST"));
    }

    public void innerLeftBottomNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 8));
        cuboidList.add(pixelCuboid(0, 8, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_NORTH"));
    }

    public void innerLeftBottomSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 8, 16, 8, 8));
        cuboidList.add(pixelCuboid(8, 8, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_SOUTH"));
    }

    public void innerLeftBottomEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 8));
        cuboidList.add(pixelCuboid(8, 8, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_EAST"));
    }

    public void innerLeftBottomWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.BOTTOM);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 8, 8, 16, 8, 8));
        cuboidList.add(pixelCuboid(0, 8, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_BOTTOM", "LAUFBAU_FACING_WEST"));
    }

    public void innerLeftTopNorthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.NORTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 8));
        cuboidList.add(pixelCuboid(0, 0, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_NORTH"));
    }

    public void innerLeftTopSouthStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.SOUTH);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 8, 16, 8, 8));
        cuboidList.add(pixelCuboid(8, 0, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_SOUTH"));
    }

    public void innerLeftTopEastStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.EAST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 0, 16, 8, 8));
        cuboidList.add(pixelCuboid(8, 0, 8, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_EAST"));
    }

    public void innerLeftTopWestStair() {
        Stairs stairs = (Stairs) Material.END_STONE_BRICK_STAIRS.createBlockData();
        stairs.setShape(Stairs.Shape.INNER_LEFT);
        stairs.setHalf(Stairs.Half.TOP);
        stairs.setFacing(BlockFace.WEST);
        List<Cuboid> cuboidList = new ArrayList<>();
        cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16));
        cuboidList.add(pixelCuboid(0, 0, 8, 16, 8, 8));
        cuboidList.add(pixelCuboid(0, 0, 0, 8, 8, 8));
        new BlockBoundingBox(stairs, cuboidList, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS", Material.END_STONE_BRICK_STAIRS, "LAUFBAU_SHAPE_INNER_LEFT", "LAUFBAU_HALF_TOP", "LAUFBAU_FACING_WEST"));
    }
}
