use of pneumaticCraft.common.progwidgets.ProgWidgetLiquidExport in project PneumaticCraft by MineMaarten.
the class ProgrammedDroneUtils method deliverFluidAmazonStyle.
public static EntityCreature deliverFluidAmazonStyle(World world, int x, int y, int z, FluidStack deliveredFluid) {
if (world.isRemote)
return null;
if (deliveredFluid == null)
throw new IllegalArgumentException("Can't deliver a null FluidStack");
if (deliveredFluid.amount <= 0)
throw new IllegalArgumentException("Can't deliver a FluidStack with an amount of <= 0");
EntityDrone drone = getChargedDispenserUpgradeDrone(world);
//Program the drone
int startY = world.getHeightValue(x + 30, z) + 30;
drone.setPosition(x + 30, startY, z);
List<IProgWidget> widgets = drone.progWidgets;
ProgWidgetStart start = new ProgWidgetStart();
start.setX(92);
start.setY(41);
widgets.add(start);
ProgWidgetLiquidExport export = new ProgWidgetLiquidExport();
export.setX(92);
export.setY(52);
widgets.add(export);
ProgWidgetGoToLocation gotoPiece = new ProgWidgetGoToLocation();
gotoPiece.setX(92);
gotoPiece.setY(74);
widgets.add(gotoPiece);
ProgWidgetSuicide suicide = new ProgWidgetSuicide();
suicide.setX(92);
suicide.setY(85);
widgets.add(suicide);
ProgWidgetArea area = new ProgWidgetArea();
area.setX(107);
area.setY(52);
area.x1 = x;
area.y1 = y;
area.z1 = z;
widgets.add(area);
area = new ProgWidgetArea();
area.setX(107);
area.setY(74);
area.x1 = x + 30;
area.y1 = startY;
area.z1 = z;
widgets.add(area);
TileEntityProgrammer.updatePuzzleConnections(widgets);
drone.getTank().fill(deliveredFluid, true);
world.spawnEntityInWorld(drone);
return drone;
}
Aggregations