From da0e7ac7567059a88f76069b55350d52056e60d6 Mon Sep 17 00:00:00 2001 From: Gabriel PĂ©rez-Cerezo Date: Sun, 10 Jun 2018 17:40:37 +0200 Subject: make platform creation possible from other mods --- advtrains/misc_nodes.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'advtrains') diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua index 37f535d..85fb0ef 100644 --- a/advtrains/misc_nodes.lua +++ b/advtrains/misc_nodes.lua @@ -1,6 +1,6 @@ --all nodes that do not fit in any other category -function advtrains.register_platform(preset) +function advtrains.register_platform(modprefix, preset) local ndef=minetest.registered_nodes[preset] if not ndef then minetest.log("warning", " register_platform couldn't find preset node "..preset) @@ -12,7 +12,7 @@ function advtrains.register_platform(preset) end local desc=ndef.description or "" local nodename=string.match(preset, ":(.+)$") - minetest.register_node("advtrains:platform_low_"..nodename, { + minetest.register_node(modprefix .. ":platform_low_"..nodename, { description = attrans("@1 Platform (low)", desc), tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, groups = {cracky = 1, not_blocking_trains = 1, platform=1}, @@ -29,7 +29,7 @@ function advtrains.register_platform(preset) paramtype = "light", sunlight_propagates = true, }) - minetest.register_node("advtrains:platform_high_"..nodename, { + minetest.register_node(modprefix .. ":platform_high_"..nodename, { description = attrans("@1 Platform (high)", desc), tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, groups = {cracky = 1, not_blocking_trains = 1, platform=2}, @@ -48,14 +48,14 @@ function advtrains.register_platform(preset) }) minetest.register_craft({ type="shapeless", - output = "advtrains:platform_high_"..nodename.." 4", + output = modprefix .. ":platform_high_"..nodename.." 4", recipe = { "dye:yellow", preset, preset }, }) minetest.register_craft({ type="shapeless", - output = "advtrains:platform_low_"..nodename.." 4", + output = modprefix .. ":platform_low_"..nodename.." 4", recipe = { "dye:yellow", preset }, @@ -63,5 +63,5 @@ function advtrains.register_platform(preset) end -advtrains.register_platform("default:stonebrick") -advtrains.register_platform("default:sandstonebrick") +advtrains.register_platform("advtrains", "default:stonebrick") +advtrains.register_platform("advtrains", "default:sandstonebrick") -- cgit v1.2.3