/*
 *  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.core.Direction;
import net.minecraft.world.level.block.state.properties.WoodType;
import net.minecraft.world.phys.shapes.VoxelShape;
import top.r3944realms.eroticdungeongame.content.block.IWoodTypeBlock;
import top.r3944realms.eroticdungeongame.content.block.multiply.vertical.VerticalTripleSeatBlock;
import top.r3944realms.eroticdungeongame.content.block.part.AdvanceSeatPart;
import top.r3944realms.lib39.util.shape.ShapeUtil;

import java.util.EnumMap;
import java.util.Map;

public class HangingPostBlock extends VerticalTripleSeatBlock implements IWoodTypeBlock {
    private final WoodType woodType;
    public HangingPostBlock(WoodType woodType) {
        super(PROPERTIES);
        this.woodType = woodType;
    }

    @Override
    public void setupShape() {
        VoxelShape middleAndFoot = ShapeUtil.builder()
                .addPixelBox(6, 0, 12, 10, 16, 16)
                .build();
        VoxelShape head = ShapeUtil.builder()
                .addPixelBox(6, 0, 12, 10, 11, 16)
                .addPixelBox(6, 9, 0, 10, 11, 12)
                .build();
        Map<Direction, VoxelShape> mf = ShapeUtil.createUniformDirectionMap(middleAndFoot);
        EnumMap<AdvanceSeatPart, Map<Direction, VoxelShape>> shapes = new EnumMap<>(AdvanceSeatPart.class);
        shapes.put(AdvanceSeatPart.FOOT, mf);
        shapes.put(AdvanceSeatPart.MIDDLE, mf);
        shapes.put(AdvanceSeatPart.HEAD, ShapeUtil.createUniformDirectionMap(head));
        setPartMap(shapes);
    }

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