ILiquidDefinition
Link to iliquiddefinition
The ILiquidDefinition defines the liquid an ILiquidStack consists of. Unlike the ILiquidStack, this interface allows you to change fluid properties.
Импорт пакета
Link to импорт-пакета
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.ILiquidDefinition;
Методы
Link to методы
So, what can we do with it?
Умножение
Link to умножение
Multiplying a ILiquidDefinition results in a new ILiquidStack with the specified amount in millibuckets
ZenScript Copyval def = <liquid:lava>.definition;
//essentially the same
val bucketOfLava = def * 1000;
val bucketOfLava1 = <liquid:lava> * 1000;
Get and Set fluid properties
Link to get-and-set-fluid-properties
As an ILiquidDefinition represents a liquid, you can get, but also set it's properties. Check the table below for further information.
Like in the table above, you set the Zengetter/Setter at the end of the ILiquidDefinition. Some ZenGetters have no according ZenSetter, you will need to rely on other means to alter these properties.
Be careful with Zensetters though, they only alter the fluid registry and have no effect on fluids in the world. You will probably only need the temperature setter when messing with Tinkers' Construct Smeltery fuels.
ZenScript Copyval definition = <liquid:lava>.definition;
//Zengetter: luminosity
val lavaL = definition.luminosity;
//Zensetter: luminosity
definition.luminosity = 0;
Геттер | Zensetter | What is this? | Return/Set Type |
---|---|---|---|
Геттер name | Zensetter | What is this? This returns the unlocalized liquid name | Return/Set Type string |
Геттер displayName | Zensetter | What is this? This returns the localized liquid name | Return/Set Type string |
Геттер luminosity | Zensetter luminosity | What is this? This returns/sets the luminosity of the referred liquid | Return/Set Type int |
Геттер density | Zensetter density | What is this? This returns/sets the density of the referred liquid | Return/Set Type int |
Геттер temperature | Zensetter temperature | What is this? This returns/sets the temperature of the referred liquid | Return/Set Type int |
Геттер viscosity | Zensetter viscosity | What is this? This returns/sets the viscosity of the referred liquid | Return/Set Type int |
Геттер gaseous | Zensetter gaseous | What is this? This returns/sets whether the referred liquid is gaseous | Return/Set Type boolean |