Added bounding boxes for all blocks
This commit is contained in:
parent
65395632b9
commit
0820c23441
|
@ -19,6 +19,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
|
@ -46,6 +47,31 @@ public class DrawerBlock extends RotatableBlock<DrawerTile> {
|
|||
.put(Direction.WEST, Shapes.box(0, 1/16D, 1/16D, 1/16D, 15/16D, 15/16D));
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_1, type1 -> MultimapBuilder.hashKeys().arrayListValues().build())
|
||||
.put(Direction.EAST, Shapes.box(15/16D, 1/16D, 1/16D, 1, 15/16D, 15/16D));
|
||||
for (Direction direction : CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_1).keySet()) {
|
||||
for (VoxelShape voxelShape : CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_1).get(direction)) {
|
||||
AABB bounding = voxelShape.toAabbs().get(0);
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_2, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(bounding.minX, bounding.minY, bounding.minZ ,bounding.maxX, 8/16D, bounding.maxZ));
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_2, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(bounding.minX, 8/16D, bounding.minZ ,bounding.maxX, bounding.maxY, bounding.maxZ));
|
||||
}
|
||||
}
|
||||
for (Direction direction : CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_2).keySet()) {
|
||||
for (VoxelShape voxelShape : CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_2).get(direction)) {
|
||||
AABB bounding = voxelShape.toAabbs().get(0);
|
||||
if (direction == Direction.NORTH || direction == Direction.SOUTH) {
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_4, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(bounding.minX, bounding.minY, bounding.minZ , 8/16D, bounding.maxY, bounding.maxZ));
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_4, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(8/16D, bounding.minY, bounding.minZ ,bounding.maxX, bounding.maxY, bounding.maxZ));
|
||||
} else {
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_4, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(bounding.minX, bounding.minY, bounding.minZ , bounding.maxX, bounding.maxY, 8/16D));
|
||||
CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_4, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()).
|
||||
put(direction, Shapes.box(bounding.minX, bounding.minY, 8/16D,bounding.maxX, bounding.maxY, bounding.maxZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final FunctionalStorage.DrawerType type;
|
||||
|
|
Loading…
Reference in New Issue
Block a user