Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundRecipePacket.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
2#pragma once
3
6#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
8#endif
9
10namespace ProtocolCraft
11{
12 enum class RecipeState
13 {
14 Init = 0,
15 Add = 1,
16 Remove = 2
17 };
18
19 class ClientboundRecipePacket : public BaseMessage<ClientboundRecipePacket>
20 {
21 public:
22 static constexpr std::string_view packet_name = "Recipe";
23
24 DEFINE_CONDITION(IsInit, GetState() == RecipeState::Init);
25
26 SERIALIZED_FIELD(State, Internal::DiffType<RecipeState, VarInt>);
27 SERIALIZED_FIELD(BookSettings, RecipeBookSettings);
28#if PROTOCOL_VERSION < 393 /* < 1.13 */
29 SERIALIZED_FIELD(Recipes, std::vector<VarInt>);
30 SERIALIZED_FIELD(ToHighlight, Internal::Conditioned<std::vector<VarInt>, &THIS::IsInit>);
31#else
32 SERIALIZED_FIELD(Recipes, std::vector<Identifier>);
33 SERIALIZED_FIELD(ToHighlight, Internal::Conditioned<std::vector<Identifier>, &THIS::IsInit>);
34#endif
35
37 };
38} //ProtocolCraft
39#endif
#define DEFINE_CONDITION(Name,...)
Define a condition that can be used later inside an Internal::Conditioned type.
#define DECLARE_READ_WRITE_SERIALIZE
Define auto serializable utilities and declare ReadImpl, WriteImpl and SerializeImpl virtual function...
#define SERIALIZED_FIELD(Name,...)