Skip to main content

pumpkinplus/modules/recipes/
painting.rs

1//! Painting variant recipes.
2//!
3//! Intended to provide stonecutter recipes that produce each painting variant
4//! with the correct data component. Currently implemented as shapeless recipes
5//! until Pumpkin exposes stonecutter or data-component recipe APIs.
6//!
7//! ## Recipe
8//!
9//! | Input (1×) | Output (1×)          | Variant      |
10//! |------------|----------------------|--------------|
11//! | `painting` | `painting` (variant) | `kebab`      |
12//! | `painting` | `painting` (variant) | `aztec`      |
13//! | ...        | ...                  | ...          |
14//!
15//! > **Note:** The original IllyriaPlus implementation uses Paper's
16//! > `DataComponentTypes.PAINTING_VARIANT` via the stonecutter. Pumpkin's
17//! > current WIT recipe bindings do not expose data components or stonecutter
18//! > recipes, so these are stored as shapeless placeholders. They will need
19//! > upstream support to function identically.
20
21use crate::modules::recipes::recipe::{Ingredient, ItemStack, Recipe, ShapelessRecipe};
22
23/// Handles painting variant recipes.
24///
25/// **Stub:** Waiting for Pumpkin API support for stonecutter recipes
26/// and item data components.
27#[derive(Default)]
28pub struct Painting;
29
30impl Recipe for Painting {
31    fn shapeless(&self) -> Vec<ShapelessRecipe> {
32        // Vanilla painting variants as of Minecraft 1.21.4
33        let variants: Vec<&str> = vec![
34            "kebab",
35            "aztec",
36            "alban",
37            "aztec2",
38            "bomb",
39            "plant",
40            "wasteland",
41            "pool",
42            "courbet",
43            "sea",
44            "sunset",
45            "creebet",
46            "wanderer",
47            "graham",
48            "match",
49            "bust",
50            "stage",
51            "void",
52            "skull_and_roses",
53            "wither",
54            "fighters",
55            "pointer",
56            "pigscene",
57            "burning_skull",
58            "skeleton",
59            "donkey_kong",
60            "earth",
61            "wind",
62            "fire",
63            "water",
64            "baroque",
65            "humble",
66            "meditative",
67            "owlemons",
68            "passage",
69            "pond",
70            "unpacked",
71        ];
72
73        variants
74            .into_iter()
75            .map(|variant| ShapelessRecipe {
76                id: format!("pumpkinplus:painting_{}_stonecutting", variant),
77                ingredients: vec![Ingredient::Item {
78                    id: "minecraft:painting".into(),
79                }],
80                result: ItemStack {
81                    id: "minecraft:painting".into(),
82                    count: 1,
83                },
84            })
85            .collect()
86    }
87}