Data
Data:is_valid([type]) | Is this a valid object |
Data:continue(bool) | Changes the validity of the object. |
Data:continue_if(func) | Changes the validity of the object if the passed function is true. |
Data:extend([force]) | Extend object into the data table |
Data:copy(new_name, result[, opts]) | Copies a recipe to a new recipe. |
Data:run_function(func) | Run a function if the object is valid. |
Data:get_function_results(func) | Run a function on a valid object and return its results. |
Data:set_unique_array(tab) | Set the unique array class to the field if the field is present |
Data:set_field(field, value) | Add or change a field. |
Data:set_fields(tab) | Iterate a dictionary table and set fields on the object. |
Data:get_field(field, default_value) | Get a field. |
Data:get_fields(arr, as_dictionary) | Iterate an array of fields and return the values as paramaters |
Data:remove_field(field) | Remove an indiviual field from the the object |
Data:remove_fields(arr) | Iterate a string array and set to nil. |
Data:subgroup_order([subgroup=nil][, order=nil]) | Change the item-subgroup and/or order. |
Data:replace_icon(icon, size) | Replace an icon |
Data:get_icons([copy=false]) | Get the icons |
Data:tostring() | Get the objects name. |
Data:get(object[, object_type][, opts]) | Returns a valid thing object reference. |
Is this a valid object
Parameters:
Changes the validity of the object.
Parameters:
Changes the validity of the object if the passed function is true.
Parameters:
Extend object into the data table
Parameters:
Copies a recipe to a new recipe.
Parameters: Returns:
Run a function if the object is valid.
The object and any additional paramaters are passed to the function.
Parameters:Run a function on a valid object and return its results.
Parameters:
Set the unique array class to the field if the field is present
Parameters:
Add or change a field.
Parameters:
Iterate a dictionary table and set fields on the object.
Existing fields are overwritten.
Parameters:Get a field.
Parameters:
Iterate an array of fields and return the values as paramaters
Parameters:
local icon, name = Data('stone-furnace', 'furnace'):get_fields({icon, name})
Remove an indiviual field from the the object
Parameters:
Iterate a string array and set to nil.
Parameters:
Change the item-subgroup and/or order.
Parameters:
Replace an icon
Parameters:
Get the icons
Parameters:
Get the objects name.
Returns:
Returns a valid thing object reference.
This is the main getter.
Parameters: