local function HearPanFlute(inst, musician, instrument)
    
end

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
	--inst.Transform:SetScale(1.25,1.25,1.25)
	
    inst.entity:AddAnimState()
	inst.entity:AddSoundEmitter()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("zgsabber_cup")
    inst.AnimState:SetBuild("zgsabber_cup")
    inst.AnimState:PlayAnimation("idle")

	--inst:AddTag("bell")

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end
	
	local gifttable = {
		"gears", "livinglog", "bluegem", "purplegem", "redgem",
	}
	
	inst:AddComponent("teacher")
	function inst.components.teacher:Teach(target)
		if target and target.components.hunger then
			 if target.components.hunger.current >= 100 then
				if target.components.inventory then
					target.components.inventory:GiveItem( SpawnPrefab(gifttable[math.random(#gifttable)]) )
				end
				target.components.hunger:DoDelta(-100)
				return true
			else
				inst:DoTaskInTime(0, function()
					if target.components.talker then
						target.components.talker:Say("没有足够的饱食")
					end
				end)
				return false
			end
		end
	end
	
	inst:AddComponent("inventoryitem")
	inst.components.inventoryitem.atlasname = "images/zgsabber_cup.xml"
	inst.components.inventoryitem.imagename = "zgsabber_cup"
	
    inst:AddComponent("inspectable")
 

    return inst
end

return Prefab("zgsabber_cup", fn)