4#if PROTOCOL_VERSION < 766
12#if PROTOCOL_VERSION > 769
13 class UntrustedItemStack;
19#if PROTOCOL_VERSION < 393
25#elif PROTOCOL_VERSION < 404
30#elif PROTOCOL_VERSION < 766
46#if PROTOCOL_VERSION > 765
54#if PROTOCOL_VERSION < 350
56#elif PROTOCOL_VERSION < 402
58#elif PROTOCOL_VERSION < 766
61#elif PROTOCOL_VERSION > 765
67#if PROTOCOL_VERSION > 769
93#if PROTOCOL_VERSION < 350
94 return GetBlockId() == s.GetBlockId() && GetItemDamage() == s.GetItemDamage();
96 return GetItemId() == s.GetItemId();
102#if PROTOCOL_VERSION < 350
103 return GetBlockId() == -1;
104#elif PROTOCOL_VERSION < 402
105 return GetItemId() == -1;
106#elif PROTOCOL_VERSION < 766
107 return !GetPresent();
108#elif PROTOCOL_VERSION > 765
109 return GetItemCount() <= 0 || GetItemId() == 0;
113#if PROTOCOL_VERSION < 766
114 auto& SetItemCount(
const char ItemCount_)
116 ItemCount = ItemCount_;
119#if PROTOCOL_VERSION < 350
121#elif PROTOCOL_VERSION < 402
123#elif PROTOCOL_VERSION > 401
133#if PROTOCOL_VERSION < 350
136 std::pair<int, unsigned char> GetItemId()
const
138 return {
static_cast<int>(GetBlockId()),
static_cast<unsigned char>(GetItemDamage()) };
144#if PROTOCOL_VERSION > 769
152 ItemCount = s.GetItemCount();
153 ItemId = s.GetItemId();
154 Components = s.GetComponents();
167 ItemCount = s.GetItemCount();
168 ItemId = s.GetItemId();
169 Components = s.GetComponents();
#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 DEFINE_CONDITION(Name,...)
Define a condition that can be used later inside an Internal::Conditioned type.
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD(ItemId, Internal::Conditioned< VarInt, &Slot::HasContent, false >)
DECLARE_READ_WRITE_SERIALIZE
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(ItemCount, VarInt)
DEFINE_CONDITION(HasContent, GetItemCount() > 0)
bool SameItem(const Slot &s) const
SERIALIZED_FIELD(Components, Internal::Conditioned< Components::DataComponentPatch, &Slot::HasContent, false >)
SERIALIZED_FIELD(ItemId, Internal::Conditioned< VarInt, &UntrustedItemStack::HasContent, false >)
UntrustedItemStack()=default
SERIALIZED_FIELD(Components, Internal::Conditioned< Components::LengthPrefixedDataComponentPatch, &UntrustedItemStack::HasContent, false >)
DEFINE_CONDITION(HasContent, GetItemCount() > 0)
UntrustedItemStack(const Slot &s)
SERIALIZED_FIELD(ItemCount, VarInt)
DECLARE_READ_WRITE_SERIALIZE
A type wrapper to conditionally serialize a type.