Gas a created with mods.mekatweaker.GasFactory
There are 2 methods to create a gas :
1) From an existing fluid :
import mods.mekatweaker.GasFactory;
import mods.mekatweaker.Gas;
var gas = GasFactory.createFromFluid(<liquid>);
gas.register();
2) From scratch :
#loader mekatweaker
import mods.mekatweaker.Gas;
import mods.mekatweaker.GasFactory;
var helium3 = GasFactory.createGas("helium3");
helium3.setIcon("blocks/helium3");
helium3.register();
Note that #loader mekatweaker is required.
You have a lot of method for modifying a gas :
Name of the gas:
gas.getUnlocalizedName() : String
gas.setUnlocalizedName(String) : void
Color (use in Mekanism GUI and pressurized pipes):
gas.getColor() : int
gas.setColor(int) : void
gas.isColorize() : boolean
gas.setColorize(boolean) : void
Create a liquid from gas (default: false):
gas.needFluid() : boolean
gas.setNeedFluid(boolean) : void
Create a bucket from liquid (default: true):
gas.needBucket() : boolean
gas.setNeedBucket(boolean) : void
Icon & IconFlowing (for liquid when place in the world):
gas.setIcon(string) : void
gas.setIconFlowing(string) : void
Register the gas:
gas.register() : void
Naming a gas:
MekaTweaker create a folder “resources/mekatweaker/lang/” in your modpack.
You will find a lang file (default en_us.lang) where you can add localized name like that :
gas.<unlocalized_name>=Gas Name
For our example, it would be :
gas.helium3=Helium3
Declaring texture for fluid create from gas:
You will find a file fluids.json into resources/mekatweaker/blockstates/
It already contains 2 examples:
{
"forge_marker": 1,
"variants": {
"example_fluid": {
"model": "forge:fluid",
"custom": { "fluid": "example_fluid" }
},
"example_fluid_2": {
"model": "forge:fluid",
"custom": { "fluid": "example_fluid_2" }
}
}
}
You have to change example_fluid or example_fluid_2 or add more with the unlocalized name of your gas
{
"forge_marker": 1,
"variants": {
"helium3": {
"model": "forge:fluid",
"custom": { "fluid": "helium3" }
}
}
}
Then you need to place your textures in the right folder, it is defined by the setIcon() and setIconFlowing() method.
For our example, you need to add an textures in the folder resources/mekatweaker/textures/blocks/ named “helium3.png“