Split element
Add a slot splitting button to the machine gui
The split gui element is used to add a clickable button to the machine gui. When clicked, all items present in one of the machine's input slots will be sorted to fill all slots.
The behavior is very similar to Mekanism's machines auto-sort button
All split elements must have a unique string id (that you must specify in the elements properties).
Split elements are defined in json with : "type": "custommachinery:split"
.
Properties
The split gui element has 4 mandatory properties and 9 optional properties.
Mandatory properties
"type": "custommachinery:button" //Mandatory to define a button element.
Id
Name : id
id
Description :
A string representing the id of the button, can be used in a Function requirement to check the state of the button, or in a Button requirement to make the recipe start only when the button is pressed.
Example :
The id of the button will be button1
:
"id": "button1"
Optional properties
Texture
Name : texture
texture
Description :
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 :
"texture": "custommachinery:textures/gui/base_split.png"
Example :
The file assets/textures/my_texture.png
will be used.
"texture": "namespace:textures/my_texture.png"
Texture toggle
Name : texture_toggle
texture_toggle
Description :
The location of the texture that will be rendered into the GUI when the button is toggled and pressed.
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 :
"texture_toggle": "custommachinery:textures/gui/base_split_toogle.png"
Example :
The file assets/textures/my_texture.png
will be used.
"texture_toggle": "namespace:textures/my_texture.png"
Texture hovered
Name : texture_hovered
texture_hovered
Description :
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 :
"texture_hovered": "custommachinery:textures/gui/base_split_hovered.png"
Example :
The file assets/textures/my_texture.png
will be used.
"texture_hovered": "namespace:textures/my_texture.png"
Texture toggle hovered
Name : texture_toggle_hovered
texture_toggle_hovered
Description :
The location of the texture that will be rendered into the GUI when the button is toggled and the player mouse cursor is hovering it.
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 :
"texture_toggle_hovered": "custommachinery:textures/gui/base_split_toogle_hovered.png"
Example :
The file assets/textures/my_texture.png
will be used.
"texture_toggle_hovered": "namespace:textures/my_texture.png"
Priority
Name : priority
priority
Description :
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.
"priority": 1000
Tooltips
Name : tooltips
tooltips
Description :
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 !" :
"tooltips": "Click me !"
Slots
Name : slots
slots
Description :
A list of slot ids which are the slots that will be sorted while this split button is active.
The slots ids must be the same as specified in the Item component and Slot element id
property.
If the list is empty then any normal slot (not fuel, upgrade, etc) in input
mode will be sorted.
Default : empty
empty
Example :
While this split element is active, only slots with ids input1
, input2
, input3
will be sorted.
"slots": ["input1", "input2", "input3"]
Example
A basic split element using the base texture provided by Custom Machinery :
{
"type": "custommachinery:split",
"x": 20,
"y": 20
}
Last updated