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;
}
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;
}
Aggregations