A LiquidStack consists of a Liquid Definition as well as an optional tag and an optional amount value.

Dieses Paket importieren

Link to dieses-paket-importieren

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.liquid.ILiquidStack;

Creating an ILiquidStack

Link to creating-an-iliquidstack

An ILiquidStack can be created by using the Liquid Bracket Handler

ZenScript
Copy
//see The liquid bracket Handler for further information
val lava = <liquid:lava>;

//liquid.withTag(Tag as IData)
val lavaWithTag = <liquid:lava>.withTag(DATA);

//liquid * amount in millibuckets (-> 1000 = 1 Bucket)
val lavaWithAmount = <liquid:lava> * 1000;

Get fluid properties

Link to get-fluid-properties

As an ILiquidStack represents a liquid, there surely must also be a way of retrieving the fluid's properties.
Check the table to see what you can retrieve from the ILiquidStack Object using ZenGetters.

ZenGetterWhat is this?RückgabetypBeispiel
ZenGetter
name
What is this?
This returns the unlocalized liquid name
Rückgabetyp
string
Beispiel
test = <liquid:lava>.name;
ZenGetter
displayName
What is this?
This returns the localized liquid name
Rückgabetyp
string
Beispiel
test = <liquid:lava>.displayName;
ZenGetter
amount
What is this?
This returns the amount of the ILiquidObject
Rückgabetyp
int
Beispiel
test = <liquid:lava>.amount;
ZenGetter
luminosity
What is this?
This returns the luminosity of the referred liquid
Rückgabetyp
int
Beispiel
test = <liquid:lava>.luminosity;
ZenGetter
density
What is this?
This returns the density of the referred liquid
Rückgabetyp
int
Beispiel
test = <liquid:lava>.density;
ZenGetter
temperature
What is this?
This returns the temperature of the referred liquid
Rückgabetyp
int
Beispiel
test = <liquid:lava>.temperature;
ZenGetter
viscosity
What is this?
This returns the viscosity of the referred liquid
Rückgabetyp
int
Beispiel
test = <liquid:lava>.viscosity;
ZenGetter
gaseous
What is this?
This returns whether the referred liquid is gaseous
Rückgabetyp
boolean
Beispiel
test = <liquid:lava>.gaseous;
ZenGetter
tag
What is this?
This returns the ILiquidObject's tag
Rückgabetyp
IData
Beispiel
test = <liquid:lava>.tag;
ZenGetter
definition
What is this?
This returns the referred liquid's definition (see below)
Rückgabetyp
ILiquid Definition
Beispiel
test = <liquid:lava>.definition;

IIngredient Implementaion

Link to iingredient-implementaion

Java Jargon: ILiquidStack implements IIngredient. In other words, all methods that can be used in IIngredients can also be used for ILiquidStacks Refer to the IIngredient entry for further information on this. Here are some special cases, as liquids just aren't items

  • You can't mark ILiquidStacks, and you get null of you try to retrieve an ILiquidStack's mark
  • .items returns an empty List
  • .itemArray returns an empty Array
  • .liquids returns this liquid as ILiquidStack (so, exactly this object)
  • LiquidStacks can't have Transformers and asking for transformers always returns false
  • LiquidStacks can't have Conditions (.only doesn't work)
  • Matching with items always returns false