Botcraft 26.3
Loading...
Searching...
No Matches
RecipeDisplay.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
3
9
11
12
13namespace ProtocolCraft
14{
20
21 std::shared_ptr<RecipeDisplayData> RecipeDisplay::CreateRecipeDisplayData(const RecipeDisplayDataType type)
22 {
23 switch (type)
24 {
26 return std::make_shared<ShapelessCraftingRecipeDisplay>();
28 return std::make_shared<ShapedCraftingRecipeDisplay>();
30 return std::make_shared<FurnaceRecipeDisplay>();
32 return std::make_shared<StonecutterRecipeDisplay>();
34 return std::make_shared<SmithingRecipeDisplay>();
35 default:
36 // This should not happen
37 throw std::runtime_error("Unable to create RecipeDisplayData with id: " + std::to_string(static_cast<int>(type)) + ".");
38 return nullptr;
39 }
40 }
41
43}
44#endif
#define DEFINE_NETWORK_TYPE(ClassName)
static std::shared_ptr< RecipeDisplayData > CreateRecipeDisplayData(const RecipeDisplayDataType type)