1#if PROTOCOL_VERSION > 772
51 std::shared_ptr<DebugSubscriptionData> DebugSubscriptionDataFactory(
const DebugSubscriptionDataType debug_subscription_data_type_)
53 switch (debug_subscription_data_type_)
56 return std::make_shared<DebugSubscriptionDataEmpty>();
58 return std::make_shared<DebugSubscriptionDataBeeInfo>();
60 return std::make_shared<DebugSubscriptionDataBrainDump>();
62 return std::make_shared<DebugSubscriptionDataBreezeInfo>();
64 return std::make_shared<DebugSubscriptionDataGoalInfo>();
66 return std::make_shared<DebugSubscriptionDataPathInfo>();
68 return std::make_shared<DebugSubscriptionDataEntityBlockIntersection>();
70 return std::make_shared<DebugSubscriptionDataHiveInfo>();
72 return std::make_shared<DebugSubscriptionDataPoiInfo>();
74 return std::make_shared<DebugSubscriptionDataOrientation>();
76 return std::make_shared<DebugSubscriptionDataEmpty>();
78 return std::make_shared<DebugSubscriptionDataRaids>();
80 return std::make_shared<DebugSubscriptionDataStructures>();
82 return std::make_shared<DebugSubscriptionDataGameEventListenerInfo>();
84 return std::make_shared<DebugSubscriptionDataNeighbor>();
86 return std::make_shared<DebugSubscriptionDataGameEventInfo>();
89 throw std::runtime_error(
"Unable to create debug subscription data with id: " + std::to_string(
static_cast<int>(debug_subscription_data_type_)) +
".");
100 return DebugSubscriptionDataFactory(type);
113 Type = ReadData<DebugSubscriptionDataType, VarInt>(iter, length);
114 const bool has_data = ReadData<bool>(iter, length);
117 Data = DebugSubscriptionDataFactory(Type);
118 Data.value()->Read(iter, length);
124 WriteData<DebugSubscriptionDataType, VarInt>(Type, container);
125 WriteData<bool>(Data.has_value(), container);
126 if (Data.has_value() && Data.value() !=
nullptr)
128 Data.value()->Write(container);
137 return DebugSubscriptionDataFactory(type);
#define DEFINE_NETWORK_TYPE(ClassName)
#define DEFINE_SERIALIZE(ClassName)
static std::shared_ptr< DebugSubscriptionData > CreateDebugSubscriptionData(const DebugSubscriptionDataType type)
static std::shared_ptr< DebugSubscriptionData > CreateDebugSubscriptionData(const DebugSubscriptionDataType type)
DebugSubscriptionUpdate & SetDataTypeNoData(const DebugSubscriptionDataType type)
virtual void WriteImpl(WriteContainer &container) const =0
virtual void ReadImpl(ReadIterator &iter, size_t &length)=0
DebugSubscriptionDataType
@ DedicatedServerTickTime
@ EntityBlockIntersections
@ RedstoneWireOrientations
std::vector< unsigned char > WriteContainer
std::vector< unsigned char >::const_iterator ReadIterator