aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_vmanip.cpp
diff options
context:
space:
mode:
author0gb.us <0gb.us@0gb.us>2013-09-04 12:09:52 -0700
committerSfan5 <sfan5@live.de>2013-09-06 21:42:01 +0200
commit211b372e266f18bfb337c7a863c95774111e6987 (patch)
tree97f696250667bcf1b703bab2ffcc0f4c24dad176 /src/script/lua_api/l_vmanip.cpp
parent848998003939d1617dad649dc9842b11ffc83ead (diff)
downloadminetest-211b372e266f18bfb337c7a863c95774111e6987.tar.gz
minetest-211b372e266f18bfb337c7a863c95774111e6987.tar.bz2
minetest-211b372e266f18bfb337c7a863c95774111e6987.zip
Standardized method of getting node info in dungeon mapgen.
Diffstat (limited to 'src/script/lua_api/l_vmanip.cpp')
0 files changed, 0 insertions, 0 deletions
href='#n115'>115 116 117 118 119 120 121 122 123
--all nodes that do not fit in any other category

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)
		return
	end
	local btex=ndef.tiles
	if type(btex)=="table" then
		btex=btex[1]
	end
	local desc=ndef.description or ""
	local nodename=string.match(preset, ":(.+)$")
	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},
		sounds = default.node_sound_stone_defaults(),
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = {
				{-0.5, -0.1, -0.1, 0.5,  0  , 0.5},
				{-0.5, -0.5,  0  , 0.5, -0.1, 0.5}
			},
		},
		paramtype2="facedir",
		paramtype = "light",
		sunlight_propagates = true,
	})
	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},
		sounds = default.node_sound_stone_defaults(),
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = {
				{-0.5,  0.3, 0, 0.5,  0.5, 0.5},
				{-0.5, -0.5, 0.1  , 0.5,  0.3, 0.5}
			},
		},
		paramtype2="facedir",
		paramtype = "light",
		sunlight_propagates = true,
	})
	local diagonalbox = {
			type = "fixed",
			fixed = {
				{-0.5,  -0.5, 0.5, -0.25, 0.5, -0.8 },
				{-0.25, -0.5, 0.5 , 0,    0.5, -0.55},
				{0,     -0.5, 0.5 , 0.25, 0.5, -0.3 },
				{0.25 , -0.5, 0.5,  0.5,  0.5, -0.05}
			}
	}
	minetest.register_node(modprefix..":platform_45_"..nodename, {
		description = attrans("@1 Platform (45 degree)", desc),
		groups = {cracky = 1, not_blocking_trains = 1, platform=2},
		sounds = default.node_sound_stone_defaults(),
		drawtype = "mesh",
		mesh = "advtrains_platform_diag.b3d",
		selection_box = diagonalbox,
		collision_box = diagonalbox,
		tiles = {btex, btex.."^advtrains_platform_diag.png"},
		paramtype2 = "facedir",
		paramtype = "light",
		sunlight_propagates = true,
	})
	local diagonalbox_low = {
			type = "fixed",
			fixed = {
				{-0.5,  -0.5, 0.5, -0.25, 0, -0.8 },