/*
 *  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.client.renderer.block;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.minecraft.core.Direction;
import software.bernie.geckolib.renderer.GeoBlockRenderer;
import top.r3944realms.eroticdungeongame.client.model.block.IronCageBlockModel;
import top.r3944realms.eroticdungeongame.content.block.blockentity.IronCageBlockEntity;

public class IronCageBlockRenderer extends GeoBlockRenderer<IronCageBlockEntity> {
    public IronCageBlockRenderer() {
        super(new IronCageBlockModel());
    }
    @Override
    protected void rotateBlock(Direction facing, PoseStack poseStack) {
        switch (facing) {
            case WEST -> poseStack.mulPose(Axis.YP.rotationDegrees(0));    // 西为基准，0度
            case NORTH -> poseStack.mulPose(Axis.YP.rotationDegrees(270));   // 北：西旋转90度
            case EAST -> poseStack.mulPose(Axis.YP.rotationDegrees(180));   // 东：西旋转180度
            case SOUTH -> poseStack.mulPose(Axis.YP.rotationDegrees(90));  // 南：西旋转270度
            case UP -> poseStack.mulPose(Axis.XP.rotationDegrees(90));
            case DOWN -> poseStack.mulPose(Axis.XN.rotationDegrees(90));
        }
    }

}
