3d_printer/api.txt

15 lines
750 B
Plaintext

To register your own blueprint use:
plastic_printer_data:register_blueprint(item, description, cost, drawing_image)
See the example below:
plastic_printer_data:register_blueprint("foomod:foobar", "Foo", "5", "foo_bar.png")
The result will be an item whose name will be "foomod:foobar_blueprint", description will be "Foo blueprint", cost will be "basic_materials:plastic_sheet 5"
The parameter drawing_image is optional, it overlays the blueprint image. If nil, the item inventory image will be a blank blueprint.
Every parameter filled in the function needs to be a string, except for drawing_image, which can be nil.
NOTE: Don't forget to make your mod depend on this one, otherwise the printer will not work properly and will cause crashes.