Search in sources :

Example 1 with ProgWidgetLiquidExport

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;
}
Also used : IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget) EntityDrone(pneumaticCraft.common.entity.living.EntityDrone) ProgWidgetGoToLocation(pneumaticCraft.common.progwidgets.ProgWidgetGoToLocation) ProgWidgetArea(pneumaticCraft.common.progwidgets.ProgWidgetArea) ProgWidgetLiquidExport(pneumaticCraft.common.progwidgets.ProgWidgetLiquidExport) ProgWidgetSuicide(pneumaticCraft.common.progwidgets.ProgWidgetSuicide) ProgWidgetStart(pneumaticCraft.common.progwidgets.ProgWidgetStart)

Aggregations

EntityDrone (pneumaticCraft.common.entity.living.EntityDrone)1 IProgWidget (pneumaticCraft.common.progwidgets.IProgWidget)1 ProgWidgetArea (pneumaticCraft.common.progwidgets.ProgWidgetArea)1 ProgWidgetGoToLocation (pneumaticCraft.common.progwidgets.ProgWidgetGoToLocation)1 ProgWidgetLiquidExport (pneumaticCraft.common.progwidgets.ProgWidgetLiquidExport)1 ProgWidgetStart (pneumaticCraft.common.progwidgets.ProgWidgetStart)1 ProgWidgetSuicide (pneumaticCraft.common.progwidgets.ProgWidgetSuicide)1