Skip to content

Liquid Interaction

misterplus edited this page Apr 3, 2020 · 9 revisions

Calling

You can call the Liquid package by mods.plustweaks.Liquid.

Removing

If you want to remove any of the three vanilla liquid interactions, you can find those options in Plus Tweaks' config file.

Removal of modded liquid interactions are currently not possible, I suggest looking into that mod's config file.

Adding

There are two functions for adding a new liquid interaction: mods.plustweaks.Liquid.registerLiquidInteraction(ILiquidStack liquid1, ILiquidStack liquid2, IBlockState block, int[] levels);

This means that when liquid1 meets liquid2, and the height level of liquid1 matches any value in levels, it'll produce the specified block.

A height level of 0 means a liquid source, and the max value for a height level is 15.

Example:

mods.plustweaks.Liquid.registerLiquidInteraction(<liquid:water>, <liquid:iron>, <blockstate:minecraft:iron_block>, [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] as int[]);

This means when molten iron from TConstruct meets a non-source water block, a iron block will be produced.

Alternatively, you can call this function:

mods.plustweaks.Liquid.registerLiquidInteraction(ILiquidStack liquid1, ILiquidStack liquid2, IBlockState block, @Optional boolean source);

If source is set to true, then levels will be replaced with [0], if source is omitted or set to false, levels will be replaced with [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].

Which means you can write the example sentence in this way:

mods.plustweaks.Liquid.registerLiquidInteraction(<liquid:water>, <liquid:iron>, <blockstate:minecraft:iron_block>);

If the result is not as consistent as you think, you can try to swap the two liquid parameters (in a non-source interaction) for maybe better results.

Also vertical interaction is also not very stable due to density reasons (denser liquids will consume lighter ones).

Clone this wiki locally