Botcraft 26.3
Loading...
Searching...
No Matches
SlotDisplay.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
3
11#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
15#endif
16
18
19namespace ProtocolCraft
20{
28#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
32#endif
33
34
35 std::shared_ptr<SlotDisplayData> SlotDisplay::CreateSlotDisplayData(const SlotDisplayDataType type)
36 {
37 switch (type)
38 {
41 return std::make_shared<SlotDisplayDataEmpty>();
43 return std::make_shared<ItemSlotDisplay>();
45 return std::make_shared<ItemStackSlotDisplay>();
47 return std::make_shared<TagSlotDisplay>();
49 return std::make_shared<SmithingTrimDemoSlotDisplay>();
51 return std::make_shared<WithRemainderSlotDisplay>();
53 return std::make_shared<CompositeSlotDisplay>();
54#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
56 return std::make_shared<WithAnyPotionSlotDisplay>();
58 return std::make_shared<OnlyWithComponentSlotDisplay>();
60 return std::make_shared<DyedSlotDemoDisplayData>();
61#endif
62 default:
63 // This should not happen
64 throw std::runtime_error("Unable to create SlotDisplayData with id: " + std::to_string(static_cast<int>(type)) + ".");
65 return nullptr;
66 }
67
68 // This should not happen
69 return nullptr;
70 }
71
73}
74#endif
#define DEFINE_NETWORK_TYPE(ClassName)
static std::shared_ptr< SlotDisplayData > CreateSlotDisplayData(const SlotDisplayDataType type)