namespace plasmascreen and inbox (#22)
@@ -12,7 +12,7 @@ read_globals = {
 | 
				
			|||||||
	"VoxelManip", "VoxelArea",
 | 
						"VoxelManip", "VoxelArea",
 | 
				
			||||||
	"PseudoRandom", "ItemStack",
 | 
						"PseudoRandom", "ItemStack",
 | 
				
			||||||
	"default",
 | 
						"default",
 | 
				
			||||||
	"screwdriver",
 | 
						"screwdriver", "homedecor",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
globals = {
 | 
					globals = {
 | 
				
			||||||
@@ -3,7 +3,7 @@ local S = minetest.get_translator("inbox")
 | 
				
			|||||||
local inbox = {}
 | 
					local inbox = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output ="inbox:empty",
 | 
						output ="homedecor:inbox",
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{"","default:steel_ingot",""},
 | 
							{"","default:steel_ingot",""},
 | 
				
			||||||
		{"default:steel_ingot","","default:steel_ingot"},
 | 
							{"default:steel_ingot","","default:steel_ingot"},
 | 
				
			||||||
@@ -16,17 +16,17 @@ local mb_cbox = {
 | 
				
			|||||||
	fixed = { -5/16, -8/16, -8/16, 5/16, 2/16, 8/16 }
 | 
						fixed = { -5/16, -8/16, -8/16, 5/16, 2/16, 8/16 }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("inbox:empty", {
 | 
					homedecor.register("inbox", {
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	drawtype = "mesh",
 | 
						drawtype = "mesh",
 | 
				
			||||||
	mesh = "inbox_mailbox.obj",
 | 
						mesh = "homedecor_inbox_mailbox.obj",
 | 
				
			||||||
	description = S("Mailbox"),
 | 
						description = S("Mailbox"),
 | 
				
			||||||
	tiles = {
 | 
						tiles = {
 | 
				
			||||||
		"inbox_red_metal.png",
 | 
							"homedecor_inbox_red_metal.png",
 | 
				
			||||||
		"inbox_white_metal.png",
 | 
							"homedecor_inbox_white_metal.png",
 | 
				
			||||||
		"inbox_grey_metal.png",
 | 
							"homedecor_inbox_grey_metal.png",
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	inventory_image = "mailbox_inv.png",
 | 
						inventory_image = "homedecor_mailbox_inv.png",
 | 
				
			||||||
	selection_box = mb_cbox,
 | 
						selection_box = mb_cbox,
 | 
				
			||||||
	collision_box = mb_cbox,
 | 
						collision_box = mb_cbox,
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
@@ -105,6 +105,8 @@ minetest.register_node("inbox:empty", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_alias("inbox:empty", "homedecor:inbox")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function inbox.get_inbox_formspec(pos)
 | 
					function inbox.get_inbox_formspec(pos)
 | 
				
			||||||
	local spos = pos.x .. "," .. pos.y .. "," ..pos.z
 | 
						local spos = pos.x .. "," .. pos.y .. "," ..pos.z
 | 
				
			||||||
	local formspec =
 | 
						local formspec =
 | 
				
			||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
name = inbox
 | 
					name = homedecor_inbox
 | 
				
			||||||
depends = default, homedecor_common
 | 
					depends = default, homedecor_common
 | 
				
			||||||
optional_depends = screwdriver
 | 
					optional_depends = screwdriver
 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B  | 
| 
		 Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B  | 
| 
		 Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B  | 
| 
		 Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB  | 
@@ -11,7 +11,7 @@ read_globals = {
 | 
				
			|||||||
	"vector", "nodeupdate",
 | 
						"vector", "nodeupdate",
 | 
				
			||||||
	"VoxelManip", "VoxelArea",
 | 
						"VoxelManip", "VoxelArea",
 | 
				
			||||||
	"PseudoRandom", "ItemStack",
 | 
						"PseudoRandom", "ItemStack",
 | 
				
			||||||
	"screwdriver",
 | 
						"screwdriver", "homedecor",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
globals = {
 | 
					globals = {
 | 
				
			||||||
@@ -2,9 +2,9 @@ local S = minetest.get_translator("plasmascreen")
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil
 | 
					local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("plasmascreen:stand", {
 | 
					homedecor.register("tv_stand", {
 | 
				
			||||||
	description = S("Plasma Screen TV Stand"),
 | 
						description = S("Plasma Screen TV Stand"),
 | 
				
			||||||
	tiles = {"plasmascreen_back.png"},
 | 
						tiles = {"homedecor_plasmascreen_back.png"},
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	drawtype = "nodebox",
 | 
						drawtype = "nodebox",
 | 
				
			||||||
@@ -26,13 +26,6 @@ minetest.register_node("plasmascreen:stand", {
 | 
				
			|||||||
	groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2},
 | 
						groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("plasmascreen:screen1", "air")
 | 
					 | 
				
			||||||
minetest.register_alias("plasmascreen:screen2", "air")
 | 
					 | 
				
			||||||
minetest.register_alias("plasmascreen:screen3", "air")
 | 
					 | 
				
			||||||
minetest.register_alias("plasmascreen:screen4", "air")
 | 
					 | 
				
			||||||
minetest.register_alias("plasmascreen:screen5", "plasmascreen:tv")
 | 
					 | 
				
			||||||
minetest.register_alias("plasmascreen:screen6", "air")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local fdir_to_left = {
 | 
					local fdir_to_left = {
 | 
				
			||||||
	{ -1,  0 },
 | 
						{ -1,  0 },
 | 
				
			||||||
	{  0,  1 },
 | 
						{  0,  1 },
 | 
				
			||||||
@@ -95,13 +88,13 @@ local function checkwall(pos)
 | 
				
			|||||||
	return true
 | 
						return true
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("plasmascreen:tv", {
 | 
					homedecor.register("tv", {
 | 
				
			||||||
	description = S("Plasma TV"),
 | 
						description = S("Plasma TV"),
 | 
				
			||||||
	drawtype = "mesh",
 | 
						drawtype = "mesh",
 | 
				
			||||||
	mesh = "plasmascreen_tv.obj",
 | 
						mesh = "homedecor_plasmascreen_tv.obj",
 | 
				
			||||||
	tiles = {
 | 
						tiles = {
 | 
				
			||||||
		"plasmascreen_case.png",
 | 
							"homedecor_plasmascreen_case.png",
 | 
				
			||||||
		{ name="plasmascreen_video.png",
 | 
							{ name="homedecor_plasmascreen_video.png",
 | 
				
			||||||
			animation={
 | 
								animation={
 | 
				
			||||||
				type="vertical_frames",
 | 
									type="vertical_frames",
 | 
				
			||||||
				aspect_w = 42,
 | 
									aspect_w = 42,
 | 
				
			||||||
@@ -111,8 +104,8 @@ minetest.register_node("plasmascreen:tv", {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	inventory_image = "plasmascreen_tv_inv.png",
 | 
						inventory_image = "homedecor_plasmascreen_tv_inv.png",
 | 
				
			||||||
	wield_image = "plasmascreen_tv_inv.png",
 | 
						wield_image = "homedecor_plasmascreen_tv_inv.png",
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	light_source = 10,
 | 
						light_source = 10,
 | 
				
			||||||
@@ -127,20 +120,20 @@ minetest.register_node("plasmascreen:tv", {
 | 
				
			|||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
						on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
				
			||||||
		minetest.set_node(pos, {name = "plasmascreen:tv_off", param2 = node.param2})
 | 
							minetest.set_node(pos, {name = "homedecor:tv_off", param2 = node.param2})
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("plasmascreen:tv_off", {
 | 
					homedecor.register("tv_off", {
 | 
				
			||||||
	description = S("Plasma TV (off)"),
 | 
						description = S("Plasma TV (off)"),
 | 
				
			||||||
	drawtype = "mesh",
 | 
						drawtype = "mesh",
 | 
				
			||||||
	mesh = "plasmascreen_tv.obj",
 | 
						mesh = "homedecor_plasmascreen_tv.obj",
 | 
				
			||||||
	tiles = {
 | 
						tiles = {
 | 
				
			||||||
		"plasmascreen_case_off.png",
 | 
							"homedecor_plasmascreen_case_off.png",
 | 
				
			||||||
		"plasmascreen_screen_off.png",
 | 
							"homedecor_plasmascreen_screen_off.png",
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	inventory_image = "plasmascreen_tv_inv.png",
 | 
						inventory_image = "homedecor_plasmascreen_tv_inv.png",
 | 
				
			||||||
	wield_image = "plasmascreen_tv_inv.png",
 | 
						wield_image = "homedecor_plasmascreen_tv_inv.png",
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	light_source = 10,
 | 
						light_source = 10,
 | 
				
			||||||
@@ -155,15 +148,15 @@ minetest.register_node("plasmascreen:tv_off", {
 | 
				
			|||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
						on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
				
			||||||
		minetest.set_node(pos, {name = "plasmascreen:tv", param2 = node.param2})
 | 
							minetest.set_node(pos, {name = "homedecor:tv", param2 = node.param2})
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	drop = "plasmascreen:tv"
 | 
						drop = "homedecor:tv"
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- crafting recipes
 | 
					-- crafting recipes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = "plasmascreen:tv",
 | 
						output = "homedecor:tv",
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:glass', 'default:coal_lump', 'default:glass'},
 | 
							{'default:glass', 'default:coal_lump', 'default:glass'},
 | 
				
			||||||
		{'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
 | 
							{'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
 | 
				
			||||||
@@ -173,15 +166,25 @@ minetest.register_craft({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	type = "shapeless",
 | 
						type = "shapeless",
 | 
				
			||||||
	output = "plasmascreen:tv",
 | 
						output = "homedecor:tv",
 | 
				
			||||||
	recipe = {'homedecor:television', 'homedecor:television'},
 | 
						recipe = {'homedecor:television', 'homedecor:television'},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = "plasmascreen:stand",
 | 
						output = "homedecor:tv_stand",
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'', '', ''},
 | 
							{'', '', ''},
 | 
				
			||||||
		{'', 'default:steel_ingot', ''},
 | 
							{'', 'default:steel_ingot', ''},
 | 
				
			||||||
		{'group:stick', 'default:coal_lump', 'group:stick'},
 | 
							{'group:stick', 'default:coal_lump', 'group:stick'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen1", "air")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen2", "air")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen3", "air")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen4", "air")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen6", "air")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:screen5", "homedecor:tv")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:stand", "homedecor:tv_stand")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:tv", "homedecor:tv")
 | 
				
			||||||
 | 
					minetest.register_alias("plasmascreen:tv_off", "homedecor:tv_off")
 | 
				
			||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
name = plasmascreen
 | 
					name = homedecor_plasmascreen
 | 
				
			||||||
depends = default, homedecor_common, homedecor_electronics
 | 
					depends = default, homedecor_common, homedecor_electronics
 | 
				
			||||||
optional_depends = screwdriver
 | 
					optional_depends = screwdriver
 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B  | 
| 
		 Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB  | 
| 
		 Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB  | 
| 
		 Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B  | 
| 
		 Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B  | 
| 
		 Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB  |