aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/OldLever.java
blob: fc26f913232a5f07d520093c570b96665faf1b7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package me.xmrvizzy.skyblocker.skyblock.dungeon;

import me.xmrvizzy.skyblocker.config.SkyblockerConfig;
import net.minecraft.block.Block;
import net.minecraft.block.enums.WallMountLocation;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;

public class OldLever {
    protected static final VoxelShape FLOOR_SHAPE;
    protected static final VoxelShape NORTH_SHAPE;
    protected static final VoxelShape SOUTH_SHAPE;
    protected static final VoxelShape EAST_SHAPE;
    protected static final VoxelShape WEST_SHAPE;

    public static VoxelShape getShape(WallMountLocation wallMountLocation, Direction direction) {
        if (!SkyblockerConfig.get().locations.dungeons.oldLevers)
            return null;

        if (wallMountLocation == WallMountLocation.FLOOR) {
            return FLOOR_SHAPE;
        } else if (wallMountLocation == WallMountLocation.WALL) {
            switch (direction) {
                case EAST:
                    return EAST_SHAPE;
                case WEST:
                    return WEST_SHAPE;
                case SOUTH:
                    return SOUTH_SHAPE;
                case NORTH:
                    return NORTH_SHAPE;
            }
        }
        return null;
    }

    static {
        FLOOR_SHAPE = Block.createCuboidShape(4, 0, 4, 12, 10, 12);
        NORTH_SHAPE = Block.createCuboidShape(5.0D, 3.0D, 10.0D, 11.0D, 13.0D, 16.0D);
        SOUTH_SHAPE = Block.createCuboidShape(5.0D, 3.0D, 0.0D, 11.0D, 13.0D, 6.0D);
        WEST_SHAPE = Block.createCuboidShape(10.0D, 3.0D, 5.0D, 16.0D, 13.0D, 11.0D);
        EAST_SHAPE = Block.createCuboidShape(0.0D, 3.0D, 5.0D, 6.0D, 13.0D, 11.0D);
    }
}