71 lines
3.4 KiB
Java
71 lines
3.4 KiB
Java
package com.dairymoose.modernlife.blocks;
|
|
|
|
import com.dairymoose.modernlife.util.ModernLifeUtil;
|
|
import java.util.stream.Stream;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.Direction;
|
|
import net.minecraft.world.level.BlockGetter;
|
|
import net.minecraft.world.level.block.Block;
|
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
import net.minecraft.world.phys.shapes.BooleanOp;
|
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
|
import net.minecraft.world.phys.shapes.Shapes;
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
|
|
/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/KitchenCabinetBlock.class */
|
|
public class KitchenCabinetBlock extends NightStandBlock {
|
|
protected static final VoxelShape SHAPE_SOUTH = (VoxelShape) Stream.of((Object[]) new VoxelShape[]{Block.box(9.55d, 1.8d, 16.0d, 10.8d, 2.8d, 16.5d), Block.box(0.0d, 0.0d, 0.0d, 16.0d, 16.0d, 15.0d), Block.box(0.25d, 0.5d, 15.0d, 8.0d, 15.5d, 15.5d), Block.box(1.25d, 1.5d, 15.5d, 7.0d, 14.5d, 16.1d), Block.box(0.75d, 1.0d, 15.5d, 7.5d, 15.0d, 16.075d), Block.box(9.25d, 1.5d, 15.5d, 14.75d, 14.5d, 16.1d), Block.box(8.75d, 1.0d, 15.5d, 15.25d, 15.0d, 16.05d), Block.box(8.25d, 0.5d, 15.0d, 15.75d, 15.5d, 15.5d), Block.box(5.4d, 1.85d, 16.0d, 6.65d, 2.85d, 16.5d)}).reduce((v1, v2) -> {
|
|
return Shapes.join((VoxelShape) v1, (VoxelShape) v2, BooleanOp.OR);
|
|
}).get();
|
|
protected static final VoxelShape SHAPE_WEST = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_SOUTH);
|
|
protected static final VoxelShape SHAPE_NORTH = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_WEST);
|
|
protected static final VoxelShape SHAPE_EAST = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_NORTH);
|
|
|
|
public KitchenCabinetBlock(Properties properties) {
|
|
super(properties);
|
|
this.containerDisplayLabel = "Kitchen Cabinet";
|
|
}
|
|
|
|
/* renamed from: com.dairymoose.modernlife.blocks.KitchenCabinetBlock$1 */
|
|
/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/KitchenCabinetBlock$1.class */
|
|
static /* synthetic */ class C00291 {
|
|
static final /* synthetic */ int[] $SwitchMap$net$minecraft$core$Direction = new int[Direction.values().length];
|
|
|
|
static {
|
|
try {
|
|
$SwitchMap$net$minecraft$core$Direction[Direction.NORTH.ordinal()] = 1;
|
|
} catch (NoSuchFieldError e) {
|
|
}
|
|
try {
|
|
$SwitchMap$net$minecraft$core$Direction[Direction.SOUTH.ordinal()] = 2;
|
|
} catch (NoSuchFieldError e2) {
|
|
}
|
|
try {
|
|
$SwitchMap$net$minecraft$core$Direction[Direction.EAST.ordinal()] = 3;
|
|
} catch (NoSuchFieldError e3) {
|
|
}
|
|
try {
|
|
$SwitchMap$net$minecraft$core$Direction[Direction.WEST.ordinal()] = 4;
|
|
} catch (NoSuchFieldError e4) {
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.dairymoose.modernlife.blocks.NightStandBlock
|
|
public VoxelShape getShape(BlockState bs, BlockGetter reader, BlockPos pos, CollisionContext sel) {
|
|
switch (C00291.$SwitchMap$net$minecraft$core$Direction[bs.getValue(NightStandBlock.FACING).ordinal()]) {
|
|
case 1:
|
|
return SHAPE_NORTH;
|
|
case 2:
|
|
return SHAPE_SOUTH;
|
|
case 3:
|
|
return SHAPE_EAST;
|
|
case 4:
|
|
return SHAPE_WEST;
|
|
default:
|
|
return SHAPE_NORTH;
|
|
}
|
|
}
|
|
}
|