LeviLamina
Loading...
Searching...
No Matches
JsonUtil.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/debug/log/LogArea.h"
7#include "mc/util/json_util/JsonSchemaObjectNode.h"
8#include "mc/world/item/ItemColor.h"
9#include "mc/world/level/block/BannerBlockType.h"
10
11// auto generated forward declare list
12// clang-format off
13class HashedString;
14class SemVersion;
15class Vec2;
16class Vec3;
17class Vec4;
18namespace Core { class Path; }
19namespace Core { class Result; }
20namespace Json { class Value; }
21namespace JsonUtil { class EmptyClass; }
22namespace SharedTypes::v1_21_100 { struct ChargeAttackGoalDefinition; }
23namespace SharedTypes::v1_21_100 { struct CircleAroundAnchorGoalDefinition; }
24namespace SharedTypes::v1_21_100 { struct ControlledByPlayerGoalDefinition; }
25namespace SharedTypes::v1_21_100 { struct DragonFlamingGoalDefinition; }
26namespace SharedTypes::v1_21_100 { struct EatMobGoalDefinition; }
27namespace SharedTypes::v1_21_110 { struct RoarGoalDefinition; }
28namespace SharedTypes::v1_21_110 { struct SlimeAttackGoalDefinition; }
29namespace SharedTypes::v1_21_110 { struct SlimeFloatGoalDefinition; }
30namespace SharedTypes::v1_21_110 { struct SlimeKeepOnJumpingGoalDefinition; }
31namespace SharedTypes::v1_21_110 { struct SlimeRandomDirectionGoalDefinition; }
32namespace SharedTypes::v1_21_110 { struct SniffGoalDefinition; }
33namespace SharedTypes::v1_21_110 { struct SonicBoomGoalDefinition; }
34namespace SharedTypes::v1_21_110 { struct StayNearNoteblockGoalDefinition; }
35namespace SharedTypes::v1_21_110 { struct SwimIdleGoalDefinition; }
36namespace SharedTypes::v1_21_110 { struct SwimUpForBreathGoalDefinition; }
37namespace SharedTypes::v1_21_110 { struct SwimWanderGoalDefinition; }
38namespace SharedTypes::v1_21_110 { struct SwoopAttackGoalDefinition; }
39namespace SharedTypes::v1_21_120 { struct AvoidBlockGoalDefinition; }
40namespace SharedTypes::v1_21_120 { struct AvoidMobTypeGoalDefinition; }
41namespace SharedTypes::v1_21_120 { struct DigGoalDefinition; }
42namespace SharedTypes::v1_21_120 { struct DrinkMilkGoalDefinition; }
43namespace SharedTypes::v1_21_130 { struct ExploreOutskirtsGoalDefinition; }
44namespace SharedTypes::v1_21_130 { struct InvestigateSuspiciousLocationGoalDefinition; }
45// clang-format on
46
47namespace JsonUtil {
48// functions
49// NOLINTBEGIN
50MCNAPI void LogMissingChildSchemaOption(
51 ::LogArea area,
52 ::Json::Value const& node,
53 ::std::string const& missingName,
54 ::std::string const& foundNodesStr,
55 ::std::string const& optionsStr
56);
57
58MCNAPI void buildActorGoalSchema(
59 ::std::shared_ptr<
60 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_120::AvoidBlockGoalDefinition>>&
61 root,
62 ::std::string const&
63);
64
65MCNAPI void buildActorGoalSchema(
66 ::std::shared_ptr<
67 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_120::AvoidMobTypeGoalDefinition>>&
68 root,
69 ::std::string const&
70);
71
72MCNAPI void buildActorGoalSchema(
73 ::std::shared_ptr<
74 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_120::DigGoalDefinition>>& root,
75 ::std::string const&
76);
77
78MCNAPI void buildActorGoalSchema(
79 ::std::shared_ptr<
80 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_120::DrinkMilkGoalDefinition>>&
81 root,
82 ::std::string const&
83);
84
85MCNAPI void buildActorGoalSchema(
86 ::std::shared_ptr<
87 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_100::EatMobGoalDefinition>>& root,
88 ::std::string const&
89);
90
91MCNAPI void buildActorGoalSchema(
92 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
93 ::JsonUtil::EmptyClass,
94 ::SharedTypes::v1_21_110::StayNearNoteblockGoalDefinition>>& root,
95 ::std::string const&
96);
97
98MCNAPI void buildActorGoalSchema(
99 ::std::shared_ptr<
100 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_100::ChargeAttackGoalDefinition>>&
101 root,
102 ::std::string const& name
103);
104
105MCNAPI void buildActorGoalSchema(
106 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
107 ::JsonUtil::EmptyClass,
108 ::SharedTypes::v1_21_100::CircleAroundAnchorGoalDefinition>>& root,
109 ::std::string const& name
110);
111
112MCNAPI void buildActorGoalSchema(
113 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
114 ::JsonUtil::EmptyClass,
115 ::SharedTypes::v1_21_100::ControlledByPlayerGoalDefinition>>& root,
116 ::std::string const& name
117);
118
119MCNAPI void buildActorGoalSchema(
120 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
121 ::JsonUtil::EmptyClass,
122 ::SharedTypes::v1_21_100::DragonFlamingGoalDefinition>>& root,
123 ::std::string const& name
124);
125
126MCNAPI void buildActorGoalSchema(
127 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
128 ::JsonUtil::EmptyClass,
129 ::SharedTypes::v1_21_130::ExploreOutskirtsGoalDefinition>>& root,
130 ::std::string const& name
131);
132
133MCNAPI void buildActorGoalSchema(
134 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
135 ::JsonUtil::EmptyClass,
136 ::SharedTypes::v1_21_130::InvestigateSuspiciousLocationGoalDefinition>>& root,
137 ::std::string const& name
138);
139
140MCNAPI void buildActorGoalSchema(
141 ::std::shared_ptr<
142 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::RoarGoalDefinition>>& root,
143 ::std::string const& name
144);
145
146MCNAPI void buildActorGoalSchema(
147 ::std::shared_ptr<
148 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SlimeAttackGoalDefinition>>&
149 root,
150 ::std::string const& name
151);
152
153MCNAPI void buildActorGoalSchema(
154 ::std::shared_ptr<
155 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SlimeFloatGoalDefinition>>&
156 root,
157 ::std::string const& name
158);
159
160MCNAPI void buildActorGoalSchema(
161 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
162 ::JsonUtil::EmptyClass,
163 ::SharedTypes::v1_21_110::SlimeKeepOnJumpingGoalDefinition>>& root,
164 ::std::string const& name
165);
166
167MCNAPI void buildActorGoalSchema(
168 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
169 ::JsonUtil::EmptyClass,
170 ::SharedTypes::v1_21_110::SlimeRandomDirectionGoalDefinition>>& root,
171 ::std::string const& name
172);
173
174MCNAPI void buildActorGoalSchema(
175 ::std::shared_ptr<
176 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SniffGoalDefinition>>& root,
177 ::std::string const& name
178);
179
180MCNAPI void buildActorGoalSchema(
181 ::std::shared_ptr<
182 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SonicBoomGoalDefinition>>&
183 root,
184 ::std::string const& name
185);
186
187MCNAPI void buildActorGoalSchema(
188 ::std::shared_ptr<
189 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SwimIdleGoalDefinition>>&
190 root,
191 ::std::string const& name
192);
193
194MCNAPI void buildActorGoalSchema(
195 ::std::shared_ptr<::JsonUtil::JsonSchemaObjectNode<
196 ::JsonUtil::EmptyClass,
197 ::SharedTypes::v1_21_110::SwimUpForBreathGoalDefinition>>& root,
198 ::std::string const& name
199);
200
201MCNAPI void buildActorGoalSchema(
202 ::std::shared_ptr<
203 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SwimWanderGoalDefinition>>&
204 root,
205 ::std::string const& name
206);
207
208MCNAPI void buildActorGoalSchema(
209 ::std::shared_ptr<
210 ::JsonUtil::JsonSchemaObjectNode<::JsonUtil::EmptyClass, ::SharedTypes::v1_21_110::SwoopAttackGoalDefinition>>&
211 root,
212 ::std::string const& name
213);
214
215MCNAPI_C ::Core::Result deserializeFromFile(::Json::Value& json, ::Core::Path const& path);
216
217MCNAPI void eraseSchema(::HashedString const& name, ::SemVersion const& version);
218
219MCNAPI ::Json::Value& getMemberByCaseInsensitiveName(::Json::Value& node, ::std::string_view memberName);
220
221MCNAPI ::Json::Value const&
222getMemberByCaseInsensitiveNameConst(::Json::Value const& node, ::std::string_view memberName);
223
224MCNAPI bool parseBannerBlockType(::BannerBlockType& outType, ::Json::Value const& root);
225
226MCNAPI bool
227parseItem(::std::string& outItemName, ::std::string& outItemNamespace, int& inoutItemAux, ::std::string_view inString);
228
229MCNAPI bool parseItemColor(::ItemColor& outColor, ::Json::Value const& root);
230
231MCNAPI bool parseRange(::Json::Value const& root, int& outMin, int& outMax);
232
233MCNAPI_C bool parseRange(::Json::Value const& root, float& outMin, float& outMax);
234
235MCNAPI bool parseVec2(::Vec2& outVec, ::Json::Value const& root);
236
237MCNAPI bool parseVec3(::Vec3& outVec, ::Json::Value const& root);
238
239MCNAPI_C bool parseVec4(::Vec4& outVec, ::Json::Value const& root);
240
241MCNAPI_C ::Json::Value patchJson(::Json::Value const& base, ::Json::Value const& patch, char terminator);
242
243MCNAPI void setDefaultPrettyName(::std::string& destPrettyName, ::HashedString const& sourceName);
244
245MCNAPI void unregisterSchema(::HashedString const& name, ::SemVersion const& version);
246// NOLINTEND
247
248// static variables
249// NOLINTBEGIN
250MCNAPI ::HashedString const& ACTOR_DEFINITION_TRIGGER_TYPE_NAME();
251
252MCNAPI ::HashedString const& ACTOR_FILTER_GROUP_TYPE_NAME();
253
254MCNAPI ::HashedString const& ARRAY_TYPE_NAME();
255
256MCNAPI ::HashedString const& BOOL_TYPE_NAME();
257
258MCNAPI ::HashedString const& ENTITIES_TYPE_NAME();
259
260MCNAPI ::HashedString const& ENUM_TYPE_NAME();
261
262MCNAPI ::HashedString const& FLOAT_RANGE_TYPE_NAME();
263
264MCNAPI ::HashedString const& FLOAT_TYPE_NAME();
265
266MCNAPI ::HashedString const& INT_RANGE_TYPE_NAME();
267
268MCNAPI ::HashedString const& INT_TYPE_NAME();
269
270MCNAPI ::HashedString const& MOLANG_TYPE_NAME();
271
272MCNAPI ::HashedString const& OBJECT_TYPE_NAME();
273
274MCNAPI ::HashedString const& STRING_TYPE_NAME();
275
276MCNAPI ::HashedString const& VEC2_TYPE_NAME();
277
278MCNAPI ::HashedString const& VEC3_TYPE_NAME();
279
280MCNAPI ::HashedString const& VEC4_TYPE_NAME();
281
282MCNAPI ::HashedString const& VERSION_TYPE_NAME();
283// NOLINTEND
284
285} // namespace JsonUtil
Definition Path.h:10
Definition Result.h:11
Definition HashedString.h:5
Definition EmptyClass.h:7
Definition Value.h:16
Definition SemVersion.h:15
Definition Vec2.h:5
Definition Vec3.h:10
Definition Vec4.h:5
Definition ChargeAttackGoalDefinition.h:16
Definition CircleAroundAnchorGoalDefinition.h:16
Definition ControlledByPlayerGoalDefinition.h:15
Definition DragonFlamingGoalDefinition.h:15
Definition EatMobGoalDefinition.h:15
Definition RoarGoalDefinition.h:15
Definition SlimeAttackGoalDefinition.h:15
Definition SlimeFloatGoalDefinition.h:15
Definition SlimeKeepOnJumpingGoalDefinition.h:15
Definition SlimeRandomDirectionGoalDefinition.h:15
Definition SniffGoalDefinition.h:16
Definition SonicBoomGoalDefinition.h:15
Definition StayNearNoteblockGoalDefinition.h:15
Definition SwimIdleGoalDefinition.h:15
Definition SwimUpForBreathGoalDefinition.h:15
Definition SwimWanderGoalDefinition.h:15
Definition SwoopAttackGoalDefinition.h:16
Definition AvoidBlockGoalDefinition.h:19
Definition AvoidMobTypeGoalDefinition.h:19
Definition DigGoalDefinition.h:16
Definition DrinkMilkGoalDefinition.h:16
Definition ExploreOutskirtsGoalDefinition.h:16
Definition InvestigateSuspiciousLocationGoalDefinition.h:15