use of gregtech.api.cover.ICoverable.PrimaryBoxData in project GregTech by GregTechCE.
the class BlockPipe method getCollisionBox.
private List<IndexedCuboid6> getCollisionBox(IBlockAccess world, BlockPos pos) {
IPipeTile<PipeType, NodeDataType> pipeTile = getPipeTileEntity(world, pos);
if (pipeTile == null) {
return Collections.emptyList();
}
PipeType pipeType = pipeTile.getPipeType();
if (pipeType == null) {
return Collections.emptyList();
}
int actualConnections = getActualConnections(pipeTile, world);
float thickness = pipeType.getThickness();
ArrayList<IndexedCuboid6> result = new ArrayList<>();
result.add(new IndexedCuboid6(new PrimaryBoxData(false), getSideBox(null, thickness)));
ICoverable coverable = pipeTile.getCoverableImplementation();
for (EnumFacing side : EnumFacing.VALUES) {
if ((actualConnections & 1 << side.getIndex()) > 0) {
result.add(new IndexedCuboid6(new PipeConnectionData(side), getSideBox(side, thickness)));
}
}
coverable.addCoverCollisionBoundingBox(result);
return result;
}
Aggregations