Skip to content
Snippets Groups Projects
Commit d7ac127d authored by Louis Royer's avatar Louis Royer Committed by Hugo Locurcio
Browse files

Add compatibility with mod frame

parent 8aa3cbd1
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,9 @@ stds.minetest = { ...@@ -25,7 +25,9 @@ stds.minetest = {
} }
read_globals = { read_globals = {
"carts",
"farming", "farming",
"frame",
"intllib", "intllib",
"mg", "mg",
} }
...@@ -23,6 +23,9 @@ if minetest.get_modpath("mg") then ...@@ -23,6 +23,9 @@ if minetest.get_modpath("mg") then
dofile(modpath .. "/mg.lua") dofile(modpath .. "/mg.lua")
end end
-- `frame` support
local use_frame = minetest.get_modpath("frame")
local default_stone_sounds = default.node_sound_stone_defaults() local default_stone_sounds = default.node_sound_stone_defaults()
local default_metal_sounds = default.node_sound_metal_defaults() local default_metal_sounds = default.node_sound_metal_defaults()
...@@ -89,6 +92,10 @@ local function add_ore(modname, description, mineral_name, oredef) ...@@ -89,6 +92,10 @@ local function add_ore(modname, description, mineral_name, oredef)
sounds = default_stone_sounds, sounds = default_stone_sounds,
drop = lump_item, drop = lump_item,
}) })
if use_frame then
frame.register(modname .. ":mineral_" .. mineral_name)
end
end end
if oredef.makes.block then if oredef.makes.block then
...@@ -112,6 +119,9 @@ local function add_ore(modname, description, mineral_name, oredef) ...@@ -112,6 +119,9 @@ local function add_ore(modname, description, mineral_name, oredef)
} }
}) })
end end
if use_frame then
frame.register(block_item)
end
end end
if oredef.makes.lump then if oredef.makes.lump then
...@@ -127,6 +137,9 @@ local function add_ore(modname, description, mineral_name, oredef) ...@@ -127,6 +137,9 @@ local function add_ore(modname, description, mineral_name, oredef)
recipe = lump_item, recipe = lump_item,
}) })
end end
if use_frame then
frame.register(lump_item)
end
end end
if oredef.makes.ingot then if oredef.makes.ingot then
...@@ -135,6 +148,9 @@ local function add_ore(modname, description, mineral_name, oredef) ...@@ -135,6 +148,9 @@ local function add_ore(modname, description, mineral_name, oredef)
inventory_image = img_base .. "_ingot.png", inventory_image = img_base .. "_ingot.png",
}) })
minetest.register_alias(mineral_name .. "_ingot", ingot) minetest.register_alias(mineral_name .. "_ingot", ingot)
if use_frame then
frame.register(ingot)
end
end end
if oredef.makes.chest then if oredef.makes.chest then
...@@ -217,6 +233,9 @@ local function add_ore(modname, description, mineral_name, oredef) ...@@ -217,6 +233,9 @@ local function add_ore(modname, description, mineral_name, oredef)
end end
minetest.register_alias(tool_name .. tool_post, fulltool_name) minetest.register_alias(tool_name .. tool_post, fulltool_name)
if use_frame then
frame.register(fulltool_name)
end
end end
end end
......
name = moreores name = moreores
description = Adds new ore types. description = Adds new ore types.
depends = default depends = default
optional_depends = carts,farming,intllib,mg optional_depends = carts,farming,frame,intllib,mg
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment