import shutil
import os
import glob

def create_new_model(file_name):
    # 创建物品文件
    with open(f"foods\\items\\{file_name}.json", 'w') as item_file:
        item_file.write(f"""
{{
    "model": {{
        "type": "minecraft:model",
        "model": "foods:item/{file_name}"
    }}
}}
        """)
    print(f"物品文件 {file_name}.json 已创建")

if __name__ == "__main__":
    while True:
        user_input = input("请输入文件名 (或输入'all'处理所有png文件，输入'quit'退出): ").strip()
        
        if user_input.lower() == 'quit':
            print("程序退出")
            break
        else:
            create_new_model(user_input)