/*
 *  Copyright 2025-2026 R3944Realms
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package top.r3944realms.eroticdungeongame.content.block.type;

import net.minecraft.world.level.block.state.properties.WoodType;
import net.minecraft.world.phys.shapes.VoxelShape;
import top.r3944realms.eroticdungeongame.content.block.AbstractSeatBlock;
import top.r3944realms.eroticdungeongame.content.block.IColorBlock;
import top.r3944realms.eroticdungeongame.content.block.IWoodTypeBlock;
import top.r3944realms.eroticdungeongame.util.ColorContent;
import top.r3944realms.lib39.util.shape.ShapeUtil;

public class ProneBenchBlock extends AbstractSeatBlock implements IColorBlock, IWoodTypeBlock {
    private final WoodType woodType;
    private final ColorContent colorContent;
    public ProneBenchBlock(WoodType woodType, ColorContent colorContent) {
        super(PROPERTIES);
        this.woodType = woodType;
        this.colorContent = colorContent;
    }

    @Override
    public ColorContent getColor() {
        return colorContent;
    }

    @Override
    public void setupShape() {
        VoxelShape shape = ShapeUtil.builder()
                .addShape(
                        ShapeUtil.builder()
                                .addShape(
                                        ShapeUtil.builder()
                                                .addPixelBox(13.25, 9, -4.5, 17.75, 10, 0.5)
                                                .addPixelBox(16.75, 10, -2.5, 17.75, 14, -1.5)
                                                .addPixelBox(14.25, 13, -2.5, 16.75, 14, -1.5)
                                                .addPixelBox(13.25, 10, -2.5, 14.25, 14, -1.5)
                                                .build()
                                )
                                .addShape(
                                        ShapeUtil.builder()
                                                .addPixelBox(-1.75, 9, -4.5, 2.75, 10, 0.5)
                                                .addPixelBox(-1.75, 10, -2.5, -0.75, 14, -1.5)
                                                .addPixelBox(-0.75, 13, -2.5, 1.75, 14, -1.5)
                                                .addPixelBox(1.75, 10, -2.5, 2.75, 14, -1.5)
                                                .build()
                                )
                                .addShape(
                                        ShapeUtil.builder()
                                                .addPixelBox(0.75, 8, 14.5, 5.25, 9, 19.5)
                                                .addPixelBox(1.75, 12, 16.5, 4.25, 13, 17.5)
                                                .addPixelBox(0.75, 9, 16.5, 1.75, 13, 17.5)
                                                .addPixelBox(4.25, 9, 16.5, 5.25, 13, 17.5)
                                                .build()
                                )
                                .addShape(
                                        ShapeUtil.builder()
                                                .addPixelBox(14.25, 9, 16.5, 15.25, 13, 17.5)
                                                .addPixelBox(10.75, 9, 16.5, 11.75, 13, 17.5)
                                                .addPixelBox(11.75, 12, 16.5, 14.25, 13, 17.5)
                                                .addPixelBox(10.75, 8, 14.5, 15.25, 9, 19.5)
                                                .build()
                                )
                                .addShape(
                                        ShapeUtil.builder()
                                                .addPixelBox(4.325, 9, 1, 4.4, 13.950000000000001, 11.625)
                                                .addPixelBox(11.549999999999999, 9, 1, 11.625, 13.950000000000001, 11.625)
                                                .build()
                                )
                                .build()
                )
                .addShape(
                        ShapeUtil.builder()
                                .addPixelBox(2, 0.1, 14, 4, 6.1, 16)
                                .addPixelBox(12, 0, 14, 14, 6, 16)
                                .addPixelBox(12, 0, 0, 14, 6, 2)
                                .addPixelBox(2, 0, 0, 4, 6, 2)
                                .build()
                )
                .addShape(
                        ShapeUtil.builder()
                                .addPixelBox(2, 6, -4, 4, 8, 12)
                                .addPixelBox(2, 6, 12, 4, 8, 19)
                                .addPixelBox(12, 6, 12, 14, 8, 19)
                                .addPixelBox(12, 6, -4, 14, 8, 12)
                                .addPixelBox(-1.75, 8, -3, 4, 9, -1)
                                .addPixelBox(12, 8, -3, 17.75, 9, -1)
                                .build()
                )
                .addShape(
                        ShapeUtil.builder()
                                .addPixelBox(4.28, 12.88, 0.92, 11.72, 14.06, 11.54)
                                .addPixelBox(5.03, 11.98, 0.92, 10.97, 12.91, 11.54)
                                .build()
                )
                .build();
       setShapeCacheMap(ShapeUtil.createUniformDirectionMap(shape));
    }

    @Override
    public WoodType getWoodType() {
        return woodType;
    }
}

