itemlist =
{
	TRASH =
	{
		name = "Trash",
		dir = 0,
	},
	PLANT =
	{
		name = "Plant material",
		dir = 1,
	},
	GEAR =
	{
		name = "Diving gear",
		dir = 2,
	},
	POOP =
	{
		name = "Digested matter",
		dir = 3,
	},
	GEM =
	{
		name = "Refined ore",
		dir = 4,
	},
	BATTERY =
	{
		name = "Energy",
		dir = 5,
	},
}

function create_item(id,x,y)
	local structid = MF_create("item")
	
	local data = itemlist[id]
	
	MF_setstring(structid,NAME,data.name)
	MF_setstring(structid,TYPE,id)
	MF_setdir(structid,data.dir)
	
	MF_setvalue(structid,ONLINE,1)
	MF_setvalue(structid,XPOS,x * map.tilesize + map.tilesize * 0.5)
	MF_setvalue(structid,YPOS,y * map.tilesize + map.tilesize * 0.5)
	
	additem(structid)
	
	return structid
end