VoxeLibre/mods/ITEMS/vl_hollow_logs/API.md

2.0 KiB

vl_hollow_logs

This mod registers hollow logs derived from normal logs. Hollow logs mostly have a decorative function, but some of them can be used in recipes. Changes may appear soon.

Functions:

vl_hollow_logs.register_hollow_log(defs)

This is the function that registers the hollow trunk. For a hollow log to be registered, the defs parameter must be a table that contains up to 5 values, which are, in this order, the itemstring of the hollow log, the itemstring of the stripped hollow log, the description of the hollow log, the description of the stripped hollow log and, optionally, a boolean to inform whether this trunk is NOT flammable. If the hollow log is defined as flammable, it becomes part of the hollow_log_flammable group, which allows the log to be used as fuel for furnaces and also allows it to be an ingredient for chacoal.

Examples:

-- Flammable
{"tree", "stripped_oak", "Hollow Oak Log", "Stripped Hollow Oak Log"}

-- Not flammable
{"crimson_hyphae", "stripped_crimson_hyphae", "Hollow Crimson Stem", "Stripped Hollow Crimson Stem", true}

vl_hollow_logs.register_craft(material, result)

This function records the crafting recipe for a hollow log based on its non-hollow variant. This function also defines a recipe for the stonecutter. The material and result parameters must be, respectively, the complete itemstring of the source material and the (partial) itemstring of the result. See the following examples:

vl_hollow_logs.register_craft("mcl_core:tree", "tree")

vl_hollow_logs.register_craft("mcl_crimson:stripped_crimson_hyphae", "stripped_crimson_hyphae")