Search in sources :

Example 1 with ProgWidgetLiquidFilter

use of pneumaticCraft.common.progwidgets.ProgWidgetLiquidFilter in project PneumaticCraft by MineMaarten.

the class ProgWidgetCC method getFilterForArgs.

private ProgWidgetLiquidFilter getFilterForArgs(String fluidName) throws IllegalArgumentException {
    Fluid fluid = FluidRegistry.getFluid(fluidName);
    if (fluid == null)
        throw new IllegalArgumentException("Can't find fluid for the name \"" + fluidName + "\"!");
    ProgWidgetLiquidFilter filter = new ProgWidgetLiquidFilter();
    filter.setFluid(fluid);
    return filter;
}
Also used : ProgWidgetLiquidFilter(pneumaticCraft.common.progwidgets.ProgWidgetLiquidFilter) Fluid(net.minecraftforge.fluids.Fluid)

Example 2 with ProgWidgetLiquidFilter

use of pneumaticCraft.common.progwidgets.ProgWidgetLiquidFilter in project PneumaticCraft by MineMaarten.

the class ProgrammedDroneUtils method retrieveFluidAmazonStyle.

public static EntityCreature retrieveFluidAmazonStyle(World world, int x, int y, int z, FluidStack queriedFluid) {
    if (world.isRemote)
        return null;
    if (queriedFluid == null)
        throw new IllegalArgumentException("Can't query a null FluidStack");
    if (queriedFluid.amount <= 0)
        throw new IllegalArgumentException("Can't query 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);
    int yBase = 52;
    ProgWidgetLiquidImport im = new ProgWidgetLiquidImport();
    im.setX(92);
    im.setY(yBase);
    im.setCount(queriedFluid.amount);
    im.setUseCount(true);
    widgets.add(im);
    ProgWidgetArea area = new ProgWidgetArea();
    area.setX(107);
    area.setY(yBase);
    area.x1 = x;
    area.y1 = y;
    area.z1 = z;
    widgets.add(area);
    ProgWidgetLiquidFilter filter = new ProgWidgetLiquidFilter();
    filter.setX(107);
    filter.setY(yBase + 11);
    filter.setFluid(queriedFluid.getFluid());
    widgets.add(filter);
    yBase += 22;
    ProgWidgetGoToLocation gotoPiece = new ProgWidgetGoToLocation();
    gotoPiece.setX(92);
    gotoPiece.setY(yBase);
    widgets.add(gotoPiece);
    area = new ProgWidgetArea();
    area.setX(107);
    area.setY(yBase);
    area.x1 = x + 30;
    area.y1 = startY;
    area.z1 = z;
    widgets.add(area);
    ProgWidgetSuicide suicide = new ProgWidgetSuicide();
    suicide.setX(92);
    suicide.setY(yBase + 11);
    widgets.add(suicide);
    TileEntityProgrammer.updatePuzzleConnections(widgets);
    world.spawnEntityInWorld(drone);
    return drone;
}
Also used : ProgWidgetLiquidImport(pneumaticCraft.common.progwidgets.ProgWidgetLiquidImport) IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget) EntityDrone(pneumaticCraft.common.entity.living.EntityDrone) ProgWidgetLiquidFilter(pneumaticCraft.common.progwidgets.ProgWidgetLiquidFilter) ProgWidgetGoToLocation(pneumaticCraft.common.progwidgets.ProgWidgetGoToLocation) ProgWidgetArea(pneumaticCraft.common.progwidgets.ProgWidgetArea) ProgWidgetSuicide(pneumaticCraft.common.progwidgets.ProgWidgetSuicide) ProgWidgetStart(pneumaticCraft.common.progwidgets.ProgWidgetStart)

Aggregations

ProgWidgetLiquidFilter (pneumaticCraft.common.progwidgets.ProgWidgetLiquidFilter)2 Fluid (net.minecraftforge.fluids.Fluid)1 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 ProgWidgetLiquidImport (pneumaticCraft.common.progwidgets.ProgWidgetLiquidImport)1 ProgWidgetStart (pneumaticCraft.common.progwidgets.ProgWidgetStart)1 ProgWidgetSuicide (pneumaticCraft.common.progwidgets.ProgWidgetSuicide)1