chore: more shape migration

This commit is contained in:
Michael Hillcox 2021-02-26 20:20:38 +00:00
parent e86ed6cd0f
commit 62e5c41ab5
2 changed files with 202 additions and 208 deletions

View file

@ -16,16 +16,16 @@ public final class BlockShapes {
Stream.Builder<VoxelShape> shapes = Stream.builder(); Stream.Builder<VoxelShape> shapes = Stream.builder();
public ShapeBuilder add(double x1, double y1, double z1, double x2, double y2, double z2) { public ShapeBuilder add(double x1, double y1, double z1, double x2, double y2, double z2) {
shapes.add(Block.makeCuboidShape(x1, y1, z1, x2, y2, z2)); this.shapes.add(Block.makeCuboidShape(x1, y1, z1, x2, y2, z2));
return this; return this;
} }
public Stream<VoxelShape> build() { public Stream<VoxelShape> build() {
return shapes.build(); return this.shapes.build();
} }
public Optional<VoxelShape> standardReduceBuild() { public Optional<VoxelShape> standardReduceBuild() {
return shapes.build().reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)); return this.shapes.build().reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR));
} }
public static ShapeBuilder get() { public static ShapeBuilder get() {
@ -141,4 +141,98 @@ public final class BlockShapes {
.add(7, 9, 0, 8, 10, 1).add(9, 6, 15, 10, 7, 16).add(9, 6, 0, 10, 7, 1) .add(7, 9, 0, 8, 10, 1).add(9, 6, 15, 10, 7, 16).add(9, 6, 0, 10, 7, 1)
.standardReduceBuild().get(); .standardReduceBuild().get();
} }
public static class AtomicReconstructorShape {
public static final VoxelShape SHAPE_U = Stream.of(
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(0, 0, 15, 1, 16, 16),
Block.makeCuboidShape(15, 0, 15, 16, 16, 16), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(15, 0, 0, 16, 16, 1),
Block.makeCuboidShape(0, 0, 0, 1, 16, 1), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(1, 1, 14, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 15, 2),
Block.makeCuboidShape(10, 14, 10, 11, 15, 11), Block.makeCuboidShape(10, 14, 5, 11, 15, 6),
Block.makeCuboidShape(5, 14, 10, 6, 15, 11), Block.makeCuboidShape(5, 14, 5, 6, 15, 6),
Block.makeCuboidShape(5, 14, 11, 11, 15, 14), Block.makeCuboidShape(5, 14, 2, 11, 15, 5),
Block.makeCuboidShape(2, 14, 2, 5, 15, 14), Block.makeCuboidShape(11, 14, 2, 14, 15, 14),
Block.makeCuboidShape(14, 1, 2, 15, 15, 14), Block.makeCuboidShape(1, 1, 2, 2, 15, 14),
Block.makeCuboidShape(2, 1, 2, 14, 2, 14), Block.makeCuboidShape(2, 13, 2, 14, 14, 14)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
public static final VoxelShape SHAPE_D = Stream.of(
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 0, 0, 1, 16, 1),
Block.makeCuboidShape(15, 0, 0, 16, 16, 1), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(15, 0, 15, 16, 16, 16),
Block.makeCuboidShape(0, 0, 15, 1, 16, 16), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(1, 1, 1, 15, 15, 2), Block.makeCuboidShape(1, 1, 14, 15, 15, 15),
Block.makeCuboidShape(10, 1, 5, 11, 2, 6), Block.makeCuboidShape(10, 1, 10, 11, 2, 11),
Block.makeCuboidShape(5, 1, 5, 6, 2, 6), Block.makeCuboidShape(5, 1, 10, 6, 2, 11),
Block.makeCuboidShape(5, 1, 2, 11, 2, 5), Block.makeCuboidShape(5, 1, 11, 11, 2, 14),
Block.makeCuboidShape(2, 1, 2, 5, 2, 14), Block.makeCuboidShape(11, 1, 2, 14, 2, 14),
Block.makeCuboidShape(14, 1, 2, 15, 15, 14), Block.makeCuboidShape(1, 1, 2, 2, 15, 14),
Block.makeCuboidShape(2, 14, 2, 14, 15, 14), Block.makeCuboidShape(2, 2, 2, 14, 3, 14)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
public static final VoxelShape SHAPE_N = Stream.of(
Block.makeCuboidShape(15, 1, 0, 16, 15, 1), Block.makeCuboidShape(0, 15, 0, 1, 16, 16),
Block.makeCuboidShape(15, 15, 0, 16, 16, 16), Block.makeCuboidShape(1, 15, 0, 15, 16, 1),
Block.makeCuboidShape(1, 15, 15, 15, 16, 16), Block.makeCuboidShape(1, 0, 15, 15, 1, 16),
Block.makeCuboidShape(1, 0, 0, 15, 1, 1), Block.makeCuboidShape(15, 0, 0, 16, 1, 16),
Block.makeCuboidShape(0, 0, 0, 1, 1, 16), Block.makeCuboidShape(0, 1, 15, 1, 15, 16),
Block.makeCuboidShape(15, 1, 15, 16, 15, 16), Block.makeCuboidShape(0, 1, 0, 1, 15, 1),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(10, 10, 1, 11, 11, 2), Block.makeCuboidShape(10, 5, 1, 11, 6, 2),
Block.makeCuboidShape(5, 10, 1, 6, 11, 2), Block.makeCuboidShape(5, 5, 1, 6, 6, 2),
Block.makeCuboidShape(5, 11, 1, 11, 14, 2), Block.makeCuboidShape(5, 2, 1, 11, 5, 2),
Block.makeCuboidShape(2, 2, 1, 5, 14, 2), Block.makeCuboidShape(11, 2, 1, 14, 14, 2),
Block.makeCuboidShape(14, 2, 1, 15, 14, 15), Block.makeCuboidShape(1, 2, 1, 2, 14, 15),
Block.makeCuboidShape(2, 2, 14, 14, 14, 15), Block.makeCuboidShape(2, 2, 2, 14, 14, 3)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
public static final VoxelShape SHAPE_E = Stream.of(
Block.makeCuboidShape(15, 1, 15, 16, 15, 16), Block.makeCuboidShape(0, 15, 0, 16, 16, 1),
Block.makeCuboidShape(0, 15, 15, 16, 16, 16), Block.makeCuboidShape(15, 15, 1, 16, 16, 15),
Block.makeCuboidShape(0, 15, 1, 1, 16, 15), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 0, 15, 16, 1, 16),
Block.makeCuboidShape(0, 0, 0, 16, 1, 1), Block.makeCuboidShape(0, 1, 0, 1, 15, 1),
Block.makeCuboidShape(0, 1, 15, 1, 15, 16), Block.makeCuboidShape(15, 1, 0, 16, 15, 1),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(14, 10, 10, 15, 11, 11), Block.makeCuboidShape(14, 5, 10, 15, 6, 11),
Block.makeCuboidShape(14, 10, 5, 15, 11, 6), Block.makeCuboidShape(14, 5, 5, 15, 6, 6),
Block.makeCuboidShape(14, 11, 5, 15, 14, 11), Block.makeCuboidShape(14, 2, 5, 15, 5, 11),
Block.makeCuboidShape(14, 2, 2, 15, 14, 5), Block.makeCuboidShape(14, 2, 11, 15, 14, 14),
Block.makeCuboidShape(1, 2, 14, 15, 14, 15), Block.makeCuboidShape(1, 2, 1, 15, 14, 2),
Block.makeCuboidShape(1, 2, 2, 2, 14, 14), Block.makeCuboidShape(13, 2, 2, 14, 14, 14)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
public static final VoxelShape SHAPE_S = Stream.of(
Block.makeCuboidShape(0, 1, 15, 1, 15, 16), Block.makeCuboidShape(15, 15, 0, 16, 16, 16),
Block.makeCuboidShape(0, 15, 0, 1, 16, 16), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(0, 0, 0, 1, 1, 16),
Block.makeCuboidShape(15, 0, 0, 16, 1, 16), Block.makeCuboidShape(15, 1, 0, 16, 15, 1),
Block.makeCuboidShape(0, 1, 0, 1, 15, 1), Block.makeCuboidShape(15, 1, 15, 16, 15, 16),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(5, 10, 14, 6, 11, 15), Block.makeCuboidShape(5, 5, 14, 6, 6, 15),
Block.makeCuboidShape(10, 10, 14, 11, 11, 15), Block.makeCuboidShape(10, 5, 14, 11, 6, 15),
Block.makeCuboidShape(5, 11, 14, 11, 14, 15), Block.makeCuboidShape(5, 2, 14, 11, 5, 15),
Block.makeCuboidShape(11, 2, 14, 14, 14, 15), Block.makeCuboidShape(2, 2, 14, 5, 14, 15),
Block.makeCuboidShape(1, 2, 1, 2, 14, 15), Block.makeCuboidShape(14, 2, 1, 15, 14, 15),
Block.makeCuboidShape(2, 2, 1, 14, 14, 2), Block.makeCuboidShape(2, 2, 13, 14, 14, 14)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
public static final VoxelShape SHAPE_W = Stream.of(
Block.makeCuboidShape(0, 1, 0, 1, 15, 1), Block.makeCuboidShape(0, 15, 15, 16, 16, 16),
Block.makeCuboidShape(0, 15, 0, 16, 16, 1), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(15, 0, 1, 16, 1, 15),
Block.makeCuboidShape(0, 0, 1, 1, 1, 15), Block.makeCuboidShape(0, 0, 0, 16, 1, 1),
Block.makeCuboidShape(0, 0, 15, 16, 1, 16), Block.makeCuboidShape(15, 1, 15, 16, 15, 16),
Block.makeCuboidShape(15, 1, 0, 16, 15, 1), Block.makeCuboidShape(0, 1, 15, 1, 15, 16),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(1, 10, 5, 2, 11, 6), Block.makeCuboidShape(1, 5, 5, 2, 6, 6),
Block.makeCuboidShape(1, 10, 10, 2, 11, 11), Block.makeCuboidShape(1, 5, 10, 2, 6, 11),
Block.makeCuboidShape(1, 11, 5, 2, 14, 11), Block.makeCuboidShape(1, 2, 5, 2, 5, 11),
Block.makeCuboidShape(1, 2, 11, 2, 14, 14), Block.makeCuboidShape(1, 2, 2, 2, 14, 5),
Block.makeCuboidShape(1, 2, 1, 15, 14, 2), Block.makeCuboidShape(1, 2, 14, 15, 14, 15),
Block.makeCuboidShape(14, 2, 2, 15, 14, 14), Block.makeCuboidShape(2, 2, 2, 3, 14, 14)
).reduce((v1, v2) -> VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR)).get();
}
} }

View file

@ -1,22 +1,18 @@
package de.ellpeck.actuallyadditions.common.blocks.functional; package de.ellpeck.actuallyadditions.common.blocks.functional;
import de.ellpeck.actuallyadditions.common.blocks.BlockShapes;
import de.ellpeck.actuallyadditions.common.blocks.FullyDirectionalBlock; import de.ellpeck.actuallyadditions.common.blocks.FullyDirectionalBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.ToolType; import net.minecraftforge.common.ToolType;
import java.util.stream.Stream;
public class AtomicReconstructorBlock extends FullyDirectionalBlock { public class AtomicReconstructorBlock extends FullyDirectionalBlock {
public static final DirectionProperty FACING = BlockStateProperties.FACING; public static final DirectionProperty FACING = BlockStateProperties.FACING;
@ -28,119 +24,23 @@ public class AtomicReconstructorBlock extends FullyDirectionalBlock {
.sound(SoundType.STONE)); .sound(SoundType.STONE));
} }
private static final VoxelShape SHAPE_U = Stream.of(
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(0, 0, 15, 1, 16, 16),
Block.makeCuboidShape(15, 0, 15, 16, 16, 16), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(15, 0, 0, 16, 16, 1),
Block.makeCuboidShape(0, 0, 0, 1, 16, 1), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(1, 1, 14, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 15, 2),
Block.makeCuboidShape(10, 14, 10, 11, 15, 11), Block.makeCuboidShape(10, 14, 5, 11, 15, 6),
Block.makeCuboidShape(5, 14, 10, 6, 15, 11), Block.makeCuboidShape(5, 14, 5, 6, 15, 6),
Block.makeCuboidShape(5, 14, 11, 11, 15, 14), Block.makeCuboidShape(5, 14, 2, 11, 15, 5),
Block.makeCuboidShape(2, 14, 2, 5, 15, 14), Block.makeCuboidShape(11, 14, 2, 14, 15, 14),
Block.makeCuboidShape(14, 1, 2, 15, 15, 14), Block.makeCuboidShape(1, 1, 2, 2, 15, 14),
Block.makeCuboidShape(2, 1, 2, 14, 2, 14), Block.makeCuboidShape(2, 13, 2, 14, 14, 14)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
private static final VoxelShape SHAPE_D = Stream.of(
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 0, 0, 1, 16, 1),
Block.makeCuboidShape(15, 0, 0, 16, 16, 1), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(15, 0, 15, 16, 16, 16),
Block.makeCuboidShape(0, 0, 15, 1, 16, 16), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(1, 1, 1, 15, 15, 2), Block.makeCuboidShape(1, 1, 14, 15, 15, 15),
Block.makeCuboidShape(10, 1, 5, 11, 2, 6), Block.makeCuboidShape(10, 1, 10, 11, 2, 11),
Block.makeCuboidShape(5, 1, 5, 6, 2, 6), Block.makeCuboidShape(5, 1, 10, 6, 2, 11),
Block.makeCuboidShape(5, 1, 2, 11, 2, 5), Block.makeCuboidShape(5, 1, 11, 11, 2, 14),
Block.makeCuboidShape(2, 1, 2, 5, 2, 14), Block.makeCuboidShape(11, 1, 2, 14, 2, 14),
Block.makeCuboidShape(14, 1, 2, 15, 15, 14), Block.makeCuboidShape(1, 1, 2, 2, 15, 14),
Block.makeCuboidShape(2, 14, 2, 14, 15, 14), Block.makeCuboidShape(2, 2, 2, 14, 3, 14)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
private static final VoxelShape SHAPE_N = Stream.of(
Block.makeCuboidShape(15, 1, 0, 16, 15, 1), Block.makeCuboidShape(0, 15, 0, 1, 16, 16),
Block.makeCuboidShape(15, 15, 0, 16, 16, 16), Block.makeCuboidShape(1, 15, 0, 15, 16, 1),
Block.makeCuboidShape(1, 15, 15, 15, 16, 16), Block.makeCuboidShape(1, 0, 15, 15, 1, 16),
Block.makeCuboidShape(1, 0, 0, 15, 1, 1), Block.makeCuboidShape(15, 0, 0, 16, 1, 16),
Block.makeCuboidShape(0, 0, 0, 1, 1, 16), Block.makeCuboidShape(0, 1, 15, 1, 15, 16),
Block.makeCuboidShape(15, 1, 15, 16, 15, 16), Block.makeCuboidShape(0, 1, 0, 1, 15, 1),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(10, 10, 1, 11, 11, 2), Block.makeCuboidShape(10, 5, 1, 11, 6, 2),
Block.makeCuboidShape(5, 10, 1, 6, 11, 2), Block.makeCuboidShape(5, 5, 1, 6, 6, 2),
Block.makeCuboidShape(5, 11, 1, 11, 14, 2), Block.makeCuboidShape(5, 2, 1, 11, 5, 2),
Block.makeCuboidShape(2, 2, 1, 5, 14, 2), Block.makeCuboidShape(11, 2, 1, 14, 14, 2),
Block.makeCuboidShape(14, 2, 1, 15, 14, 15), Block.makeCuboidShape(1, 2, 1, 2, 14, 15),
Block.makeCuboidShape(2, 2, 14, 14, 14, 15), Block.makeCuboidShape(2, 2, 2, 14, 14, 3)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
private static final VoxelShape SHAPE_E = Stream.of(
Block.makeCuboidShape(15, 1, 15, 16, 15, 16), Block.makeCuboidShape(0, 15, 0, 16, 16, 1),
Block.makeCuboidShape(0, 15, 15, 16, 16, 16), Block.makeCuboidShape(15, 15, 1, 16, 16, 15),
Block.makeCuboidShape(0, 15, 1, 1, 16, 15), Block.makeCuboidShape(0, 0, 1, 1, 1, 15),
Block.makeCuboidShape(15, 0, 1, 16, 1, 15), Block.makeCuboidShape(0, 0, 15, 16, 1, 16),
Block.makeCuboidShape(0, 0, 0, 16, 1, 1), Block.makeCuboidShape(0, 1, 0, 1, 15, 1),
Block.makeCuboidShape(0, 1, 15, 1, 15, 16), Block.makeCuboidShape(15, 1, 0, 16, 15, 1),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(14, 10, 10, 15, 11, 11), Block.makeCuboidShape(14, 5, 10, 15, 6, 11),
Block.makeCuboidShape(14, 10, 5, 15, 11, 6), Block.makeCuboidShape(14, 5, 5, 15, 6, 6),
Block.makeCuboidShape(14, 11, 5, 15, 14, 11), Block.makeCuboidShape(14, 2, 5, 15, 5, 11),
Block.makeCuboidShape(14, 2, 2, 15, 14, 5), Block.makeCuboidShape(14, 2, 11, 15, 14, 14),
Block.makeCuboidShape(1, 2, 14, 15, 14, 15), Block.makeCuboidShape(1, 2, 1, 15, 14, 2),
Block.makeCuboidShape(1, 2, 2, 2, 14, 14), Block.makeCuboidShape(13, 2, 2, 14, 14, 14)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
private static final VoxelShape SHAPE_S = Stream.of(
Block.makeCuboidShape(0, 1, 15, 1, 15, 16), Block.makeCuboidShape(15, 15, 0, 16, 16, 16),
Block.makeCuboidShape(0, 15, 0, 1, 16, 16), Block.makeCuboidShape(1, 15, 15, 15, 16, 16),
Block.makeCuboidShape(1, 15, 0, 15, 16, 1), Block.makeCuboidShape(1, 0, 0, 15, 1, 1),
Block.makeCuboidShape(1, 0, 15, 15, 1, 16), Block.makeCuboidShape(0, 0, 0, 1, 1, 16),
Block.makeCuboidShape(15, 0, 0, 16, 1, 16), Block.makeCuboidShape(15, 1, 0, 16, 15, 1),
Block.makeCuboidShape(0, 1, 0, 1, 15, 1), Block.makeCuboidShape(15, 1, 15, 16, 15, 16),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(5, 10, 14, 6, 11, 15), Block.makeCuboidShape(5, 5, 14, 6, 6, 15),
Block.makeCuboidShape(10, 10, 14, 11, 11, 15), Block.makeCuboidShape(10, 5, 14, 11, 6, 15),
Block.makeCuboidShape(5, 11, 14, 11, 14, 15), Block.makeCuboidShape(5, 2, 14, 11, 5, 15),
Block.makeCuboidShape(11, 2, 14, 14, 14, 15), Block.makeCuboidShape(2, 2, 14, 5, 14, 15),
Block.makeCuboidShape(1, 2, 1, 2, 14, 15), Block.makeCuboidShape(14, 2, 1, 15, 14, 15),
Block.makeCuboidShape(2, 2, 1, 14, 14, 2), Block.makeCuboidShape(2, 2, 13, 14, 14, 14)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
private static final VoxelShape SHAPE_W = Stream.of(
Block.makeCuboidShape(0, 1, 0, 1, 15, 1), Block.makeCuboidShape(0, 15, 15, 16, 16, 16),
Block.makeCuboidShape(0, 15, 0, 16, 16, 1), Block.makeCuboidShape(0, 15, 1, 1, 16, 15),
Block.makeCuboidShape(15, 15, 1, 16, 16, 15), Block.makeCuboidShape(15, 0, 1, 16, 1, 15),
Block.makeCuboidShape(0, 0, 1, 1, 1, 15), Block.makeCuboidShape(0, 0, 0, 16, 1, 1),
Block.makeCuboidShape(0, 0, 15, 16, 1, 16), Block.makeCuboidShape(15, 1, 15, 16, 15, 16),
Block.makeCuboidShape(15, 1, 0, 16, 15, 1), Block.makeCuboidShape(0, 1, 15, 1, 15, 16),
Block.makeCuboidShape(1, 14, 1, 15, 15, 15), Block.makeCuboidShape(1, 1, 1, 15, 2, 15),
Block.makeCuboidShape(1, 10, 5, 2, 11, 6), Block.makeCuboidShape(1, 5, 5, 2, 6, 6),
Block.makeCuboidShape(1, 10, 10, 2, 11, 11), Block.makeCuboidShape(1, 5, 10, 2, 6, 11),
Block.makeCuboidShape(1, 11, 5, 2, 14, 11), Block.makeCuboidShape(1, 2, 5, 2, 5, 11),
Block.makeCuboidShape(1, 2, 11, 2, 14, 14), Block.makeCuboidShape(1, 2, 2, 2, 14, 5),
Block.makeCuboidShape(1, 2, 1, 15, 14, 2), Block.makeCuboidShape(1, 2, 14, 15, 14, 15),
Block.makeCuboidShape(14, 2, 2, 15, 14, 14), Block.makeCuboidShape(2, 2, 2, 3, 14, 14)
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
switch (state.get(FACING)) { switch (state.get(FACING)) {
case UP: case UP:
return SHAPE_U; return BlockShapes.AtomicReconstructorShape.SHAPE_U;
case DOWN: case DOWN:
return SHAPE_D; return BlockShapes.AtomicReconstructorShape.SHAPE_D;
case NORTH: case NORTH:
return SHAPE_N; return BlockShapes.AtomicReconstructorShape.SHAPE_N;
case EAST: case EAST:
return SHAPE_E; return BlockShapes.AtomicReconstructorShape.SHAPE_E;
case SOUTH: case SOUTH:
return SHAPE_S; return BlockShapes.AtomicReconstructorShape.SHAPE_S;
case WEST: case WEST:
return SHAPE_W; return BlockShapes.AtomicReconstructorShape.SHAPE_W;
default: default:
return SHAPE_N; return BlockShapes.AtomicReconstructorShape.SHAPE_N;
} }
} }
} }