---------mts/we---------------
------minetest.place_schematic-------

minetest.register_craftitem("the_build_spawner:tower_1", {
	description = "Tower_1",
	inventory_image = "tower.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/tower_1.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:tower_2", {
	description = "Tower_2",
	inventory_image = "tower.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/tower_2.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:tower_3", {
	description = "Tower_3",
	inventory_image = "tower.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/tower_3.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:tower_4", {
	description = "Tower_4",
	inventory_image = "tower.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/tower_4.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:school", {
	description = "School",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/school.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:house_1", {
	description = "house_1",
	inventory_image = "house.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/house_1.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:house_2", {
	description = "house_2",
	inventory_image = "house.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/house_2.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:bank", {
	description = "bank",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/bank.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})
	

minetest.register_craftitem("the_build_spawner:minishop_north", {
	description = "minishop(north_facing)",
	inventory_image = "shop.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/mini_shop(north_facing).we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:minishop_south", {
	description = "minishop(south_facing)",
	inventory_image = "shop.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/mini_shop(south_facing).we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:minishop_west", {
	description = "minishop(west_facing)",
	inventory_image = "shop.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/mini_shop(west_facing).we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:minishop_east", {
	description = "minishop(east_facing)",
	inventory_image = "shop.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/mini_shop(east_facing).we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:bakery", {
	description = "bakery",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/bakery.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:police_station", {
	description = "Police station",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/police_station.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:hotel", {
	description = "Hotel",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/hotel.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:church", {
	description = "Church",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/church.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:restraunt", {
	description = "Restraunt",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/restraunt.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:hospital", {
	description = "Hospital",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/hospital.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:cemetery", {
	description = "Cemetery",
	inventory_image = "assets.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/cemetery.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})

minetest.register_craftitem("the_build_spawner:mall", {
	description = "Mall",
	inventory_image = "shop.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			local file = io.open(minetest.get_modpath("the_build_spawner").."/schemes/mall.we")
			local value = file:read("*a")
			file:close()
			local p = pointed_thing.above
			p.x = p.x - 5
			p.z = p.z - 2
			local count = worldedit.deserialize(pointed_thing.above, value)
			itemstack:take_item()
		end
		return itemstack
	end,
})
