Files
BP
RP
scripts
generate_foods.py
Code
4 493
generate_foods.py
#!/usr/bin/env python3
"""Generate the Cloud Kitchen food items, localization, atlas, and JS registry."""
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parent
FOOD_ROWS = """
burger|Classic Burger|fast_food|prep|ck:raw_burger_patty,minecraft:bread,minecraft:beetroot|12|8
cheeseburger|Cheeseburger|fast_food|prep|ck:raw_burger_patty,ck:mozzarella,minecraft:bread|15|9
double_burger|Double Burger|fast_food|prep|ck:raw_burger_patty,ck:raw_burger_patty,minecraft:bread|19|12
veggie_burger|Veggie Burger|fast_food|prep|minecraft:carrot,minecraft:beetroot,minecraft:bread|11|7
fries|Golden Fries|fast_food|fryer|ck:raw_fries,ck:cooking_oil|7|5
loaded_fries|Loaded Fries|fast_food|fryer|ck:raw_fries,ck:cooking_oil,ck:mozzarella|12|8
hotdog|Classic Hotdog|fast_food|prep|ck:hotdog_sausage,minecraft:bread|10|7
chili_dog|Chili Dog|fast_food|prep|ck:hotdog_sausage,minecraft:bread,ck:curry_spice|13|8
chicken_nuggets|Chicken Nuggets|fast_food|fryer|ck:chicken_nuggets,ck:cooking_oil|10|7
spicy_nuggets|Spicy Nuggets|fast_food|fryer|ck:chicken_nuggets,ck:cooking_oil,ck:curry_spice|12|8
beef_taco|Beef Taco|fast_food|prep|ck:raw_burger_patty,ck:taco_shell,minecraft:kelp|11|7
fish_taco|Fish Taco|fast_food|fryer|ck:raw_salmon,ck:taco_shell,minecraft:kelp,ck:cooking_oil|12|7
burrito|Bean Burrito|fast_food|prep|ck:tortilla,minecraft:beetroot,minecraft:carrot|11|8
breakfast_burrito|Breakfast Burrito|fast_food|prep|ck:tortilla,minecraft:egg,minecraft:potato|13|9
nachos|Cheesy Nachos|fast_food|oven|ck:tortilla,ck:mozzarella|10|6
loaded_nachos|Loaded Nachos|fast_food|oven|ck:tortilla,ck:mozzarella,ck:raw_burger_patty|15|9
chicken_wrap|Crispy Chicken Wrap|fast_food|fryer|ck:raw_chicken,ck:tortilla,ck:cooking_oil|13|8
veggie_wrap|Garden Veggie Wrap|fast_food|prep|ck:tortilla,minecraft:carrot,minecraft:beetroot|10|6
onion_rings|Onion Rings|fast_food|fryer|minecraft:potato,ck:cooking_oil|8|5
crispy_chicken_sandwich|Crispy Chicken Sandwich|fast_food|fryer|ck:raw_chicken,minecraft:bread,ck:cooking_oil|15|9
pepperoni_pizza|Pepperoni Pizza|pizzeria_pasta|oven|ck:pizza_dough,ck:tomato_sauce,ck:mozzarella,ck:hotdog_sausage|20|12
margherita_pizza|Margherita Pizza|pizzeria_pasta|oven|ck:pizza_dough,ck:tomato_sauce,ck:mozzarella|17|10
veggie_supreme_pizza|Veggie Supreme Pizza|pizzeria_pasta|oven|ck:pizza_dough,ck:tomato_sauce,ck:mozzarella,minecraft:carrot,minecraft:beetroot|19|11
cheese_burst_pizza|Cheese Burst Pizza|pizzeria_pasta|oven|ck:pizza_dough,ck:mozzarella,ck:mozzarella|20|12
bbq_chicken_pizza|BBQ Chicken Pizza|pizzeria_pasta|oven|ck:pizza_dough,ck:tomato_sauce,ck:mozzarella,ck:raw_chicken|21|12
garlic_bread|Garlic Bread|pizzeria_pasta|oven|minecraft:bread,minecraft:kelp,ck:mozzarella|9|6
lasagna|Lasagna|pizzeria_pasta|oven|ck:pasta,ck:tomato_sauce,ck:mozzarella,ck:raw_burger_patty|21|13
alfredo_pasta|Alfredo Pasta|pizzeria_pasta|oven|ck:pasta,ck:milk,ck:mozzarella|18|11
mac_and_cheese|Mac and Cheese|pizzeria_pasta|oven|ck:pasta,ck:milk,ck:mozzarella|15|10
spaghetti_bolognese|Spaghetti Bolognese|pizzeria_pasta|oven|ck:pasta,ck:tomato_sauce,ck:raw_burger_patty|19|12
pesto_pasta|Pesto Pasta|pizzeria_pasta|oven|ck:pasta,minecraft:kelp,ck:mozzarella|17|10
ravioli|Cheese Ravioli|pizzeria_pasta|oven|ck:pasta,ck:mozzarella,ck:milk|16|10
baked_ziti|Baked Ziti|pizzeria_pasta|oven|ck:pasta,ck:tomato_sauce,ck:mozzarella|17|11
meatball_sub|Meatball Sub|pizzeria_pasta|oven|ck:raw_burger_patty,minecraft:bread,ck:tomato_sauce|16|10
calzone|Cheese Calzone|pizzeria_pasta|oven|ck:pizza_dough,ck:mozzarella,ck:tomato_sauce|16|10
butter_chicken|Butter Chicken|desi_asian|oven|ck:raw_chicken,ck:milk,ck:curry_spice|22|13
chicken_biryani|Chicken Biryani|desi_asian|oven|ck:rice,ck:raw_chicken,ck:curry_spice|22|13
vegetable_biryani|Vegetable Biryani|desi_asian|oven|ck:rice,minecraft:carrot,minecraft:potato,ck:curry_spice|18|11
samosa|Golden Samosa|desi_asian|fryer|ck:samosa_dough,minecraft:potato,ck:cooking_oil|9|6
paneer_tikka|Paneer Tikka|desi_asian|oven|ck:paneer,ck:curry_spice|16|9
masala_dosa|Masala Dosa|desi_asian|oven|ck:dosa_batter,minecraft:potato,ck:curry_spice|15|9
ramen|Hearty Ramen|desi_asian|oven|ck:ramen_noodles,ck:raw_chicken,ck:egg|18|11
sushi_rolls|Salmon Sushi Rolls|desi_asian|prep|ck:sushi_rice,ck:raw_salmon,minecraft:kelp|17|9
dumplings|Steamed Dumplings|desi_asian|oven|ck:dumpling_wrapper,ck:raw_burger_patty|15|9
fried_rice|Vegetable Fried Rice|desi_asian|fryer|ck:rice,minecraft:carrot,ck:cooking_oil,ck:egg|16|10
chicken_korma|Chicken Korma|desi_asian|oven|ck:raw_chicken,ck:milk,ck:curry_spice|21|13
chana_masala|Chana Masala|desi_asian|oven|minecraft:beetroot,ck:tomato_sauce,ck:curry_spice|16|10
naan|Buttered Naan|desi_asian|oven|ck:pizza_dough,ck:milk|8|5
tandoori_chicken|Tandoori Chicken|desi_asian|oven|ck:raw_chicken,ck:curry_spice|20|12
spring_rolls|Crispy Spring Rolls|desi_asian|fryer|ck:dumpling_wrapper,minecraft:carrot,ck:cooking_oil|12|7
pad_thai|Pad Thai|desi_asian|fryer|ck:rice,ck:egg,ck:raw_chicken,ck:cooking_oil|19|11
teriyaki_bowl|Teriyaki Chicken Bowl|desi_asian|oven|ck:rice,ck:raw_chicken,ck:curry_spice|19|11
bao_buns|Steamed Bao Buns|desi_asian|oven|ck:pizza_dough,ck:raw_burger_patty|14|8
sweet_and_sour_chicken|Sweet and Sour Chicken|desi_asian|fryer|ck:raw_chicken,minecraft:apple,ck:cooking_oil|19|11
kimchi_pancake|Savory Kimchi Pancake|desi_asian|fryer|ck:dosa_batter,minecraft:beetroot,ck:cooking_oil|14|8
croissant|Buttery Croissant|bakery_desserts|oven|ck:pizza_dough,ck:milk|8|5
glazed_donut|Glazed Donut|bakery_desserts|fryer|ck:pizza_dough,ck:cooking_oil,minecraft:sugar|9|6
chocolate_donut|Chocolate Donut|bakery_desserts|fryer|ck:pizza_dough,ck:cooking_oil,minecraft:cocoa_beans|11|7
chocolate_lava_cake|Chocolate Lava Cake|bakery_desserts|oven|minecraft:wheat,minecraft:egg,minecraft:cocoa_beans,ck:milk|16|10
waffles|Golden Waffles|bakery_desserts|oven|minecraft:wheat,minecraft:egg,ck:milk|10|7
pancakes|Fluffy Pancakes|bakery_desserts|oven|minecraft:wheat,minecraft:egg,ck:milk|9|6
apple_pie|Homestyle Apple Pie|bakery_desserts|oven|minecraft:apple,minecraft:wheat,minecraft:sugar|12|8
cheesecake|Creamy Cheesecake|bakery_desserts|oven|ck:mozzarella,ck:milk,minecraft:sugar,minecraft:wheat|15|9
brownies|Fudge Brownies|bakery_desserts|oven|minecraft:cocoa_beans,minecraft:wheat,minecraft:sugar,minecraft:egg|12|8
cinnamon_roll|Cinnamon Roll|bakery_desserts|oven|ck:pizza_dough,minecraft:sugar|10|7
blueberry_muffin|Blueberry Muffin|bakery_desserts|oven|minecraft:wheat,minecraft:sweet_berries,minecraft:egg|10|7
banana_bread|Banana Bread|bakery_desserts|oven|minecraft:wheat,minecraft:apple,minecraft:egg|10|7
sugar_cookie|Sugar Cookie|bakery_desserts|oven|minecraft:wheat,minecraft:sugar|6|4
cream_puff|Vanilla Cream Puff|bakery_desserts|oven|ck:pizza_dough,ck:milk,minecraft:sugar|12|8
baklava|Honey Baklava|bakery_desserts|oven|ck:pizza_dough,minecraft:honey_bottle,minecraft:sugar|14|9
roast_chicken|Herb Roast Chicken|grilled_roasts|oven|ck:raw_chicken,minecraft:potato|23|14
steak_platter|Steak Platter|grilled_roasts|oven|ck:raw_burger_patty,minecraft:potato,minecraft:carrot|25|15
bbq_ribs|Smoky BBQ Ribs|grilled_roasts|oven|ck:raw_ribs,ck:curry_spice|24|15
beef_kebab|Grilled Beef Kebab|grilled_roasts|oven|ck:raw_burger_patty,minecraft:carrot|16|10
chicken_kebab|Spiced Chicken Kebab|grilled_roasts|oven|ck:raw_chicken,ck:curry_spice|16|10
grilled_salmon|Grilled Salmon|grilled_roasts|oven|ck:raw_salmon,minecraft:kelp|18|11
lamb_chops|Roasted Lamb Chops|grilled_roasts|oven|ck:raw_lamb_chops,minecraft:potato|23|14
grilled_vegetables|Grilled Vegetable Platter|grilled_roasts|oven|minecraft:carrot,minecraft:potato,minecraft:beetroot|13|8
smoked_brisket|Slow-Smoked Brisket|grilled_roasts|oven|ck:raw_burger_patty,ck:curry_spice|24|15
grilled_pork_chop|Grilled Pork Chop|grilled_roasts|oven|minecraft:porkchop,minecraft:potato|18|11
herb_roasted_lamb|Herb-Roasted Lamb|grilled_roasts|oven|ck:raw_lamb_chops,minecraft:carrot,ck:curry_spice|25|15
honey_glazed_ham|Honey-Glazed Ham|grilled_roasts|oven|minecraft:porkchop,minecraft:honey_bottle|22|13
grilled_tuna|Grilled Tuna Steak|grilled_roasts|oven|ck:raw_salmon,ck:curry_spice|19|11
roast_turkey|Festive Roast Turkey|grilled_roasts|oven|ck:raw_chicken,minecraft:potato,minecraft:carrot|26|16
stuffed_peppers|Stuffed Peppers|grilled_roasts|oven|minecraft:beetroot,ck:rice,ck:raw_burger_patty|17|10
boba_tea|Brown Sugar Boba Tea|beverages_shakes|mixer|ck:milk,ck:boba_pearls,minecraft:sugar|14|6
mango_lassi|Mango Lassi|beverages_shakes|mixer|ck:milk,minecraft:apple,ck:curry_spice|12|6
cold_coffee|Iced Coffee|beverages_shakes|mixer|ck:milk,minecraft:cocoa_beans,minecraft:ice|12|5
berry_smoothie|Berry Smoothie|beverages_shakes|mixer|ck:milk,minecraft:sweet_berries|11|6
cola|Fizzy Cola|beverages_shakes|mixer|minecraft:sugar,minecraft:water_bucket|9|4
lemonade|Fresh Lemonade|beverages_shakes|mixer|minecraft:sugar,minecraft:water_bucket,minecraft:glow_berries|9|4
oreo_shake|Cookie Crumble Shake|beverages_shakes|mixer|ck:milk,minecraft:cookie,minecraft:sugar|15|7
strawberry_milkshake|Strawberry Milkshake|beverages_shakes|mixer|ck:milk,minecraft:sweet_berries,minecraft:sugar|13|7
chocolate_milkshake|Chocolate Milkshake|beverages_shakes|mixer|ck:milk,minecraft:cocoa_beans,minecraft:sugar|13|7
iced_tea|Peach Iced Tea|beverages_shakes|mixer|minecraft:sugar,minecraft:water_bucket,minecraft:apple|10|4
hot_chocolate|Rich Hot Chocolate|beverages_shakes|mixer|ck:milk,minecraft:cocoa_beans,minecraft:sugar|12|6
orange_soda|Orange Fizz|beverages_shakes|mixer|minecraft:sugar,minecraft:water_bucket,minecraft:glow_berries|9|4
apple_juice|Chilled Apple Juice|beverages_shakes|mixer|minecraft:apple,minecraft:water_bucket|9|4
watermelon_juice|Watermelon Cooler|beverages_shakes|mixer|minecraft:melon_slice,minecraft:water_bucket|10|5
vanilla_frappe|Vanilla Frappe|beverages_shakes|mixer|ck:milk,minecraft:sugar,minecraft:snowball|13|6
""".strip()
INGREDIENT_ROWS = """
raw_burger_patty|Raw Burger Patty|beef_raw|2
raw_fries|Prepared Potato Fries|potato|2
hotdog_sausage|Hotdog Sausage|porkchop_raw|2
chicken_nuggets|Raw Chicken Nuggets|chicken_raw|2
tortilla|Soft Tortilla|bread|2
taco_shell|Crunchy Taco Shell|bread|2
pizza_dough|Pizza Dough|bread|2
tomato_sauce|Tomato Sauce|beetroot|1
mozzarella|Mozzarella Cheese|milk_bucket|2
pasta|Uncooked Pasta|wheat|2
rice|Rice|wheat_seeds|1
curry_spice|Curry Spice Blend|dye_powder_orange|1
samosa_dough|Samosa Dough|bread|2
paneer|Fresh Paneer|milk_bucket|2
dosa_batter|Dosa Batter|wheat|2
ramen_noodles|Ramen Noodles|wheat|2
sushi_rice|Seasoned Sushi Rice|wheat|2
dumpling_wrapper|Dumpling Wrapper|bread|2
raw_chicken|Raw Chicken Portions|chicken_raw|2
raw_salmon|Raw Salmon Fillet|fish_salmon_raw|2
raw_ribs|Raw Rib Rack|porkchop_raw|2
raw_lamb_chops|Raw Lamb Chops|mutton_raw|2
cooking_oil|Cooking Oil|honey_bottle|1
milk|Fresh Milk|milk_bucket|1
boba_pearls|Tapioca Boba Pearls|slimeball|1
""".strip()
FOOD_TEXTURES = {
"fast_food": "textures/items/cooked_beef",
"pizzeria_pasta": "textures/items/bread",
"desi_asian": "textures/items/cooked_chicken",
"bakery_desserts": "textures/items/cookie",
"grilled_roasts": "textures/items/cooked_beef",
"beverages_shakes": "textures/items/potion_bottle_drink",
}
def parse_foods():
foods = []
for line in FOOD_ROWS.splitlines():
item_id, name, category, appliance, ingredient_ids, payout, nutrition = line.split("|")
foods.append({
"id": f"ck:{item_id}",
"name": name,
"category": category,
"appliance": appliance,
"ingredients": ingredient_ids.split(","),
"payout": int(payout),
"nutrition": int(nutrition),
})
return foods
def parse_ingredients():
ingredients = []
for line in INGREDIENT_ROWS.splitlines():
item_id, name, texture, nutrition = line.split("|")
ingredients.append({
"id": f"ck:{item_id}",
"name": name,
"texture": f"textures/items/{texture}",
"nutrition": int(nutrition),
})
return ingredients
def make_registry_source():
return f'''const FOOD_ROWS = `
{FOOD_ROWS}
`.trim();
const INGREDIENT_ROWS = `
{INGREDIENT_ROWS}
`.trim();
const parseFoods = (rows) => rows.split("\\n").map((row) => {{
const [id, name, category, appliance, ingredientList, payout, nutrition] = row.split("|");
return {{
id: `ck:${{id}}`,
name,
category,
appliance,
ingredients: ingredientList.split(","),
payout: Number(payout),
nutrition: Number(nutrition),
}};
}});