79 lines
3.6 KiB
Java
79 lines
3.6 KiB
Java
package com.dairymoose.modernlife.blocks;
|
|
|
|
import com.dairymoose.modernlife.tileentities.WallShelfBlockEntity;
|
|
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.EntityBlock;
|
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
|
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/DoubleWallShelfBlock.class */
|
|
public class DoubleWallShelfBlock extends WallShelfBlock implements EntityBlock {
|
|
protected static final VoxelShape SHAPE_SOUTH_DOUBLE = (VoxelShape) Stream.of((Object[]) new VoxelShape[]{Block.box(0.0d, 1.0d, 0.0d, 16.0d, 5.5d, 6.0d), Block.box(0.0d, 9.0d, 0.0d, 16.0d, 13.5d, 6.0d)}).reduce((v1, v2) -> {
|
|
return Shapes.join((VoxelShape) v1, (VoxelShape) v2, BooleanOp.OR);
|
|
}).get();
|
|
protected static final VoxelShape SHAPE_WEST_DOUBLE = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_SOUTH_DOUBLE);
|
|
protected static final VoxelShape SHAPE_NORTH_DOUBLE = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_WEST_DOUBLE);
|
|
protected static final VoxelShape SHAPE_EAST_DOUBLE = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_NORTH_DOUBLE);
|
|
|
|
public DoubleWallShelfBlock(Properties props) {
|
|
super(props);
|
|
}
|
|
|
|
@Override // com.dairymoose.modernlife.blocks.WallShelfBlock
|
|
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
|
WallShelfBlockEntity toReturn = (WallShelfBlockEntity) WallShelfBlockEntity.DOUBLE_WALL_SHELF.create(pos, state);
|
|
return toReturn;
|
|
}
|
|
|
|
/* renamed from: com.dairymoose.modernlife.blocks.DoubleWallShelfBlock$1 */
|
|
/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/DoubleWallShelfBlock$1.class */
|
|
static /* synthetic */ class C00171 {
|
|
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.WallShelfBlock
|
|
public VoxelShape getShape(BlockState bs, BlockGetter reader, BlockPos pos, CollisionContext sel) {
|
|
switch (C00171.$SwitchMap$net$minecraft$core$Direction[bs.getValue(WallShelfBlock.FACING).ordinal()]) {
|
|
case 1:
|
|
return SHAPE_NORTH_DOUBLE;
|
|
case 2:
|
|
return SHAPE_SOUTH_DOUBLE;
|
|
case 3:
|
|
return SHAPE_EAST_DOUBLE;
|
|
case 4:
|
|
return SHAPE_WEST_DOUBLE;
|
|
default:
|
|
return WallShelfBlock.SHAPE_NORTH;
|
|
}
|
|
}
|
|
}
|