Java Code Examples for net.minecraftforge.fluids.FluidRegistry#getFluidStack()

The following examples show how to use net.minecraftforge.fluids.FluidRegistry#getFluidStack() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecipeHandlerMoistener.java    From NEI-Integration with MIT License 6 votes vote down vote up
public CachedMoistenerRecipe(MachineMoistener.Recipe recipe, MoistenerFuel fuel) {
    this.tank = new PositionedFluidTank(FluidRegistry.getFluidStack("water", 10000), 10000, new Rectangle(11, 5, 16, 58), RecipeHandlerMoistener.this.getGuiTexture(), new Point(176, 0));
    this.tank.showAmount = false;
    if (fuel.item != null) {
        this.fuels.add(new PositionedStack(fuel.item, 34, 47));
    }
    if (fuel.product != null) {
        this.fuels.add(new PositionedStack(fuel.product, 100, 26));
    }
    if (recipe.resource != null) {
        this.input = new PositionedStack(recipe.resource, 138, 8);
    }
    if (recipe.product != null) {
        this.output = new PositionedStack(recipe.product, 138, 44);
    }
}
 
Example 2
Source File: GT_TileEntity_THTR.java    From bartworks with MIT License 6 votes vote down vote up
@Override
public boolean checkRecipe(ItemStack controllerStack) {

    if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000))
        return false;

    reduceSupply();
    addBurnedOutBalls();
    this.updateSlots();

    this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)};

    this.mEUt=0;
    this.mMaxProgresstime=648000;
    return true;
}
 
Example 3
Source File: RecipeHandlerSewer.java    From NEI-Integration with MIT License 5 votes vote down vote up
public CachedSewerRecipe(boolean essenceRecipe) {
    this.essenceRecipe = essenceRecipe;
    if (!essenceRecipe) {
        this.tank = new PositionedFluidTank(FluidRegistry.getFluidStack("sewage", 4000), 4000, new Rectangle(141, 2, 16, 60), RecipeHandlerSewer.this.getGuiTexture(), new Point(176, 0));
    } else {
        this.tank = new PositionedFluidTank(FluidRegistry.getFluidStack("mobessence", 4000), 4000, new Rectangle(121, 2, 16, 60), RecipeHandlerSewer.this.getGuiTexture(), new Point(176, 0));
    }
    this.tank.showAmount = false;
}
 
Example 4
Source File: RecipeHandlerSlaughterhouse.java    From NEI-Integration with MIT License 5 votes vote down vote up
public CachedSlaughterhouseRecipe() {
    PositionedFluidTank tank = new PositionedFluidTank(FluidRegistry.getFluidStack("meat", 4000), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerSlaughterhouse.this.getGuiTexture(), new Point(176, 0));
    tank.showAmount = false;
    this.tanks.add(tank);
    tank = new PositionedFluidTank(FluidRegistry.getFluidStack("pinkslime", 4000), 4000, new Rectangle(91, 2, 16, 60), RecipeHandlerSlaughterhouse.this.getGuiTexture(), new Point(176, 0));
    tank.showAmount = false;
    this.tanks.add(tank);
}
 
Example 5
Source File: BioObjectAdder.java    From bartworks with MIT License 5 votes vote down vote up
/**
 * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this.
 */
public static void regenerateBioFluids() {
    FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
    for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
        if (B.getFluidNotSet()) {
            B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()}));
            if (!FluidRegistry.registerFluid(B.getFluid()))
                new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace();
            GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120);
        }
    }
}
 
Example 6
Source File: GTMaterialGen.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
/** How to get a GTFluidTube of any fluid by name **/
public static ItemStack getModdedTube(String name, int count) {
	FluidStack fluid = FluidRegistry.getFluidStack(name, 1000);
	ItemStack stack = new ItemStack(GTItems.testTube);
	IFluidHandlerItem handler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null);
	handler.fill(fluid, true);
	stack.setCount(count);
	return stack;
}
 
Example 7
Source File: FluidLoader.java    From bartworks with MIT License 5 votes vote down vote up
public static void run() {
        FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId();
        short[] rgb = new short[3];
        Arrays.fill(rgb, (short) 255);
        FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb);
        FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20));
        FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720);
        FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85));
        FluidLoader.BioLabFluidMaterials = new Fluid[]{
                new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}),
                new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}),
                new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}),
                new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}),
        };

        FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length];
        for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) {
            FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]);
            FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000));
        }

//        BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB())));
        FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
        for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
            if (B.isBreedable()) {
                B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()}));
                FluidRegistry.registerFluid(B.getFluid());
                GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid");
                GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120);
            }
        }

        FluidLoader.bioFluidBlock = new BioFluidBlock();
        GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock");
        GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge");
        if (SideReference.Side.Client) {
            RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance);
            RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance);
        }
    }
 
Example 8
Source File: GTMaterialGen.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
/** How to get a GT Gas/Fluid FluidStack directly of a custom amount **/
public static FluidStack getFluidStack(GTMaterial mat, int amount) {
	String name = mat.getDisplayName().toLowerCase();
	return FluidRegistry.getFluidStack(name, amount);
}
 
Example 9
Source File: GTMaterialGen.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
/** How to get any FluidStack of a custom amount **/
public static FluidStack getFluidStack(String name, int amount) {
	return FluidRegistry.getFluidStack(name, amount);
}
 
Example 10
Source File: WrappedFluidStackImpl.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
@Nullable
@Override
public FluidStack getFluidStack()
{
    return FluidRegistry.getFluidStack(fluid, amount);
}
 
Example 11
Source File: RecipeHandlerHarvester.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedHarvesterRecipe() {
    this.sludgeOutput = new PositionedFluidTank(FluidRegistry.getFluidStack("sludge", sludgePerOperation), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerHarvester.this.getGuiTexture(), new Point(176, 0));
}
 
Example 12
Source File: RecipeHandlerGrinder.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedGrinderRecipe() {
    this.tank = new PositionedFluidTank(FluidRegistry.getFluidStack("mobessence", 4000), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerGrinder.this.getGuiTexture(), new Point(176, 0));
    this.tank.showAmount = false;
}
 
Example 13
Source File: RecipeHandlerSludgeBoiler.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedSludgeBoilerRecipe(ItemStack output, int weight) {
    this.sludgeInput = new PositionedFluidTank(FluidRegistry.getFluidStack("sludge", sludgePerOperation), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerSludgeBoiler.this.getGuiTexture(), new Point(176, 0));
    this.output = new PositionedStack(output, 48, 24);
    this.chance = (float) weight / (float) totalWeight;
}
 
Example 14
Source File: RecipeHandlerBioReactor.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedBioReactorRecipe(ItemStack input) {
    this.input = new PositionedStack(input, 9, 6);
    this.biofuelOutput = new PositionedFluidTank(FluidRegistry.getFluidStack("biofuel", 4000), 4000, new Rectangle(121, 2, 16, 60), RecipeHandlerBioReactor.this.getGuiTexture(), new Point(176, 0));
    this.biofuelOutput.showAmount = false;
}
 
Example 15
Source File: RecipeHandlerLavaFabricator.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedLavaFabricatorRecipe() {
    this.lavaOutput = new PositionedFluidTank(FluidRegistry.getFluidStack("lava", lavaPerOperation), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerLavaFabricator.this.getGuiTexture(), new Point(176, 0));
}
 
Example 16
Source File: RecipeHandlerComposter.java    From NEI-Integration with MIT License 4 votes vote down vote up
public CachedComposterRecipe() {
    this.sewageInput = new PositionedFluidTank(FluidRegistry.getFluidStack("sewage", sewagePerOperation), 4000, new Rectangle(111, 2, 16, 60), RecipeHandlerComposter.this.getGuiTexture(), new Point(176, 0));
    this.output = new PositionedStack(new ItemStack(fertilizer), 48, 24);
}
 
Example 17
Source File: StaticRecipeChangeLoaders.java    From bartworks with MIT License 4 votes vote down vote up
private static FluidStack getWrongNameFluid(Werkstoff werkstoff) {
    String name = werkstoff.getFluidOrGas(1).getFluid().getName();
    String wrongname = "molten." + name;
    return FluidRegistry.getFluidStack(wrongname, 1);
}