Add support to register grinder recipes in Crafting Guide Plus
cg_plus mod support (6511eb8261
)
This commit is contained in:
parent
f9431c5e09
commit
c6ad781d5d
@ -15,7 +15,7 @@ read_globals = {
|
||||
}
|
||||
|
||||
files["ball.lua"] = {globals = {"boneworld.killxp"}}
|
||||
files["grinder.lua"] = {read_globals = {"i3"}}
|
||||
files["grinder.lua"] = {read_globals = {"cg", "i3"}}
|
||||
files["keypad.lua"] = {read_globals = {"signs_lib"}}
|
||||
files["machines_configuration.lua"] = {max_line_length = 190}
|
||||
files["mark.lua"] = {globals = {"machines"}}
|
||||
|
21
grinder.lua
21
grinder.lua
@ -8,6 +8,7 @@ local machines_minstep = basic_machines.properties.machines_minstep
|
||||
local twodigits_float = basic_machines.twodigits_float
|
||||
local use_unified_inventory = minetest.global_exists("unified_inventory")
|
||||
local use_i3 = minetest.global_exists("i3")
|
||||
local use_cg_plus = minetest.global_exists("cg") -- Skaapdev add support for cg_plus mod
|
||||
local use_default = basic_machines.use_default
|
||||
-- grinder recipes:
|
||||
-- ["in"] = {fuel cost, "out", quantity of material produced, quantity of material required for processing}
|
||||
@ -26,6 +27,18 @@ elseif use_i3 then
|
||||
description = F(S("Grinding")),
|
||||
icon = "basic_machines_grinder.png"
|
||||
})
|
||||
elseif use_cg_plus then -- Skaapdev add support for cg_plus mod
|
||||
cg.register_crafting_method("basic_machines_grinding", {
|
||||
description = S("Grinding"),
|
||||
arrow_icon = "basic_machines_grinder.png",
|
||||
uses_crafting_grid = false,
|
||||
get_grid_size = function()
|
||||
return {x = 1, y = 1}
|
||||
end,
|
||||
get_infotext = function(craft)
|
||||
return minetest.colorize("#FFFF00", S("Power: @1", craft.power))
|
||||
end
|
||||
}) -- skaapdev end
|
||||
end
|
||||
|
||||
local function register_recipe(name, def)
|
||||
@ -58,6 +71,14 @@ local function register_recipe(name, def)
|
||||
result = def[2] .. " " .. def[3],
|
||||
items = {name .. " " .. def[4]}
|
||||
})
|
||||
elseif use_cg_plus then -- Skaapdev add support for cg_plus mod
|
||||
cg.register_craft({
|
||||
method = "basic_machines_grinding",
|
||||
width = 0,
|
||||
items = {name .. " " .. def[4]},
|
||||
output = def[2] .. " " .. def[3],
|
||||
power = def[1]
|
||||
}) -- skaapdev end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user