Botcraft 1.21.5
Loading...
Searching...
No Matches
Recipe.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 347 /* > 1.12.2 */ && PROTOCOL_VERSION < 768 /* < 1.21.2 */
2#pragma once
3
6
7#include <memory>
8#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
9#include <string_view>
10#endif
11
12namespace ProtocolCraft
13{
14#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
15 enum class RecipeDataType
16 {
17 None = -1,
20 CraftingSpecialArmordye,
21 CraftingSpecialBookcloning,
22 CraftingSpecialMapcloning,
23 CraftingSpecialMapextending,
24 CraftingSpecialFireworkRocket,
25 CraftingSpecialFireworkStar,
26 CraftingSpecialFireworkStarFade,
27 CraftingSpecialTippedarrow,
28 CraftingSpecialBannerduplicate,
29 CraftingSpecialShielddecoration,
30 CraftingSpecialShulkerboxcoloring,
31 CraftingSpecialSuspiciousstew,
32 CraftingSpecialRepairitem,
33 Smelting,
34 Blasting,
35 Smoking,
36 CampfireCooking,
37 Stonecutting,
38 SmithingTransform,
40 CraftingDecoratedPot,
41 NUM_RECIPE_DATA_TYPES
42 };
43#endif
44
45 class RecipeData;
46
47 class Recipe : public NetworkType
48 {
49 SERIALIZED_FIELD(RecipeId, Identifier);
50#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
52#else
53 SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Type, RecipeDataType);
54#endif
55 SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Data, std::shared_ptr<RecipeData>);
56
58
59 GETTER(Type);
60 GETTER(Data);
61
62 public:
63 virtual ~Recipe() override;
64
65#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
66 Recipe& SetType(const Identifier& type_);
67#else
68 Recipe& SetType(const RecipeDataType type_);
69#endif
70
71
72#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
73 std::string_view GetName() const;
74#endif
75 };
76}
77#endif
#define SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Name,...)
Define a field that will be automatically integrated in Read/Write and Json serialization We start by...
#define DECLARE_READ_WRITE_SERIALIZE
Define auto serializable utilities and declare ReadImpl, WriteImpl and SerializeImpl virtual function...
#define SERIALIZED_FIELD(Name,...)
#define GETTER(Name)