use of network.rs485.logisticspipes.world.DoubleCoordinates in project LogisticsPipes by RS485.
the class HSTubeCurve method getConnectedEndTile.
@Override
public TileEntity getConnectedEndTile(ForgeDirection output) {
TurnDirection ori = orientation.getRenderOrientation();
if (ori.dir2 == output) {
return container.getTile(output);
}
if (ori.dir1 == output) {
DoubleCoordinates pos = new DoubleCoordinates(-2, 0, 2);
LPPositionSet<DoubleCoordinates> set = new LPPositionSet<>(DoubleCoordinates.class);
set.add(pos);
orientation.rotatePositions(set);
TileEntity subTile = pos.add(getLPPosition()).getTileEntity(getWorld());
if (subTile instanceof LogisticsTileGenericSubMultiBlock) {
return ((LogisticsTileGenericSubMultiBlock) subTile).getTile(output);
}
}
return null;
}
use of network.rs485.logisticspipes.world.DoubleCoordinates in project LogisticsPipes by RS485.
the class HSTubeLine method addCollisionBoxesToList.
@Override
public void addCollisionBoxesToList(List arraylist, AxisAlignedBB axisalignedbb) {
DoubleCoordinates pos = getLPPosition();
LPPositionSet<DoubleCoordinates> set = new LPPositionSet<>(DoubleCoordinates.class);
set.addFrom(LineTubeRenderer.tubeLine.get(orientation.getRenderOrientation()).bounds().toAABB());
set.stream().forEach(o -> o.add(pos));
AxisAlignedBB box = set.toABB();
if (box != null && (axisalignedbb == null || axisalignedbb.intersectsWith(box))) {
arraylist.add(box);
}
}
use of network.rs485.logisticspipes.world.DoubleCoordinates in project LogisticsPipes by RS485.
the class LogisticsRoutingBoardRobot method index.
private void index() {
if (init) {
return;
}
DockingStation dock = robot.getLinkedStation();
if (dock == null) {
return;
}
DoubleCoordinates pos = new DoubleCoordinates(dock.x(), dock.y(), dock.z());
LPRobotConnectionControl.instance.addRobot(robot.worldObj, pos, dock.side());
init = true;
}
use of network.rs485.logisticspipes.world.DoubleCoordinates in project LogisticsPipes by RS485.
the class HSTubeSpeedup method getConnectedEndTile.
@Override
public TileEntity getConnectedEndTile(ForgeDirection output) {
if (orientation.dir1 == output) {
DoubleCoordinates pos = new DoubleCoordinates(0, 0, -3);
LPPositionSet<DoubleCoordinates> set = new LPPositionSet<>(DoubleCoordinates.class);
set.add(pos);
orientation.rotatePositions(set);
TileEntity subTile = pos.add(getLPPosition()).getTileEntity(getWorld());
if (subTile instanceof LogisticsTileGenericSubMultiBlock) {
return ((LogisticsTileGenericSubMultiBlock) subTile).getTile(output);
}
} else if (orientation.dir1.getOpposite() == output) {
return container.getTile(output);
}
return null;
}
use of network.rs485.logisticspipes.world.DoubleCoordinates in project LogisticsPipes by RS485.
the class BCPipeInformationProvider method acceptItem.
@Override
public boolean acceptItem(LPTravelingItem item, TileEntity from) {
if (BlockGenericPipe.isValid(pipe.pipe) && pipe.pipe.transport instanceof PipeTransportItems) {
TravelingItem bcItem;
if (item instanceof LPTravelingItemServer) {
LPRoutedBCTravelingItem lpBCItem = new LPRoutedBCTravelingItem();
lpBCItem.setRoutingInformation(((LPTravelingItemServer) item).getInfo());
lpBCItem.saveToExtraNBTData();
bcItem = lpBCItem;
} else {
return true;
}
DoubleCoordinates p = new DoubleCoordinates(pipe.xCoord + 0.5F, pipe.yCoord + CoreConstants.PIPE_MIN_POS, pipe.zCoord + 0.5F);
double move;
if (item.output.getOpposite() == ForgeDirection.DOWN) {
move = 0.24;
} else if (item.output.getOpposite() == ForgeDirection.UP) {
move = 0.74;
} else {
move = 0.49;
}
CoordinateUtils.add(p, item.output.getOpposite(), move);
bcItem.setPosition(p.getXCoord(), p.getYCoord(), p.getZCoord());
bcItem.setSpeed(item.getSpeed());
if (item.getItemIdentifierStack() != null) {
bcItem.setItemStack(item.getItemIdentifierStack().makeNormalStack());
}
((PipeTransportItems) pipe.pipe.transport).injectItem(bcItem, item.output);
return true;
}
return false;
}
Aggregations