Fluid element
Customize the fluid tanks in the machine gui.
The fluid elements are used to display the content of a fluid component in the Machine GUI.
A Fluid element must be associated with a Fluid Component using the id property. It will display the fluid stored in the Fluid Component on the Machine GUI.
Fluid elements are defined in json with "type": "custommachinery:fluid".
If the fluid element cannot find the fluid Component (usually because of an error in the id) the fluid element will still be rendered but it will always be empty.
Properties
The fluid element has 4 mandatory properties and 7 optional properties :
Mandatory properties
"type": "custommachinery:fluid" //Mandatory to define a fluid element.Id
Name : id
idDescription :
The id of the Fluid Component you want to link to this element.
It must be the exact same id specified in the fluid component json id property.
Example :
The element will display the fluid component with id tank1, if no fluid component has this id it will do nothing.
"id": "tank1"Optional properties
Priority
Name : priority
priorityDescription :
An integer property that define the priority of the Element to be rendered.
Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above.
Default : 0
Example :
The element will be rendered under each element that have a priority lower than 1000.
Texture
Name : texture
textureDescription :
The location of the texture that will be rendered into the GUI.
The location must be referenced by : namespace:path/file.png The texture loader will search for textures in the assets/namespace folder, the .png extension is required or the file will not be found.
The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided.
If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case).
Default :
Example :
The file assets/textures/my_tank_texture.png will be used for the fluid element.
Texture hovered
Name : texture_hovered
texture_hoveredDescription :
The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element.
The location must be referenced by : namespace:path/file.png The texture loader will search for textures in the assets/namespace folder, the .png extension is required or the file will not be found.
The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided.
If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case).
Default :
None, the element will use the texture defined in the texture property.
Example :
The file assets/textures/my_texture.png will be used.
Tooltips
Name : tooltips
tooltipsDescription :
A list of Text components that will be shown as tooltips when the player mouse cursor hover the element.
Each tooltips of the list will be a new line.
Example :
Replace the default tooltips with a single line that say "Click me !" :
Example :
A basic fluid element linked to a fluid component using the id "tank1" and using the default texture :
Result :

(Here the Fluid Component contains 4000mB of Water)
Last updated