LeviLamina
Loading...
Searching...
No Matches
Globals.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/debug/log/LogLevel.h"
7#include "mc/deps/core/file/file_system/FileType.h"
8#include "mc/deps/core/sem_ver/SemVersionBase.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/deps/ecs/strict/EntityModifier.h"
11#include "mc/deps/json/ValueType.h"
12#include "mc/deps/shared_types/legacy/FilterSubject.h"
13#include "mc/deps/shared_types/legacy/item/UseAnimation.h"
14#include "mc/events/TextProcessingEventOrigin.h"
15#include "mc/external/lib_http_client/HCTraceLevel.h"
16#include "mc/external/lib_http_client/http_stl_allocator.h"
17#include "mc/external/libsrtp/srtp_err_status_t.h"
18#include "mc/network/packet/AgentActionType.h"
19#include "mc/options/DiscoveryEnvironment.h"
20#include "mc/util/HudElement.h"
21#include "mc/util/gltf/Accessor.h"
22#include "mc/util/gltf/Image.h"
23#include "mc/util/gltf/Material.h"
24#include "mc/world/actor/ActorCategory.h"
25#include "mc/world/actor/ActorFilterGroup.h"
26#include "mc/world/actor/ActorType.h"
27#include "mc/world/actor/ActorTypeNamespaceRules.h"
28#include "mc/world/containers/ContainerEnumName.h"
29#include "mc/world/filters/FilterGroup.h"
30#include "mc/world/filters/FilterOperator.h"
31#include "mc/world/item/CreativeItemCategory.h"
32#include "mc/world/level/WorldVersion.h"
33#include "mc/world/level/block/BlockProperty.h"
34#include "mc/world/level/block/BlockSlot.h"
35#include "mc/world/level/chunk/LevelChunkTag.h"
36#include "mc/world/level/chunk/SubChunkDelayedDeleter.h"
37#include "mc/world/level/chunk/SubChunkStorage.h"
38#include "mc/world/level/material/MaterialType.h"
39#include "mc/world/level/saveddata/maps/MapItemSavedData.h"
40#include "mc/world/redstone/circuit/components/CircuitComponentType.h"
41
42// auto generated forward declare list
43// clang-format off
44class Actor;
46class Biome;
47class BiomeArea;
48class Block;
49class BlockLegacy;
50class BlockPos;
51class BlockSource;
52class BlockState;
53class BoundingBox;
59class Dimension;
61class HashedString;
62class I18n;
63class IFileAccess;
65class ItemInstance;
67class LevelData;
68class ListTag;
73class ThirdPartyInfo;
74class WorkerPool;
77struct ActorFactoryData;
78struct ActorMapping;
80struct BlockLayer;
81struct DynDnsResult;
82struct HCTraceImplArea;
83struct HC_CALL;
85struct KeyOrNameResult;
86struct MCRESULT;
93struct TypeMapping;
95struct srtp_auth_t;
96namespace Bedrock { class StaticOptimizedString; }
97namespace Bedrock { class WorkerPoolHandleInterface; }
98namespace Core { class File; }
99namespace Core { class PathView; }
100namespace Core { class Result; }
101namespace Json { class Value; }
102namespace RakNet { class RakPeerInterface; }
103namespace RakNet { struct RakPeerConfiguration; }
104namespace cereal { struct ReflectionCtx; }
105// clang-format on
106
107// functions
108// NOLINTBEGIN
109MCAPI void BedrockLogOut(uint, char const*, ...);
110
111MCAPI ::CreativeItemCategory CreativeItemCategoryFromString(::std::string const& str);
112
113MCAPI void* DefaultMemAllocFunction(uint64, uint);
114
115MCAPI void DefaultMemFreeFunction(void*, uint);
116
117MCFOLD void DefaultOutOfMemoryHandler(char const* file, long line);
118
119MCAPI bool DoesMockCallMatch(::HC_CALL const*, ::HC_CALL const*);
120
121MCAPI ::HashedString const& EntityCanonicalName(::ActorType entityType);
122
123MCAPI ::ActorType EntityTypeFromString(::std::string const& str);
124
125MCAPI ::std::string EntityTypeToFormattedLocString(::ActorType entityType, ::ActorTypeNamespaceRules namespaceRule);
126
127MCAPI ::std::string EntityTypeToLocString(::ActorType entityType, ::ActorTypeNamespaceRules namespaceRule);
128
129MCAPI ::std::string EntityTypeToString(::ActorType entityType, ::ActorTypeNamespaceRules namespaceRule);
130
131MCAPI void EntityTypeToStringAndNamespace(::ActorType entityType, ::std::string& nameOut, ::std::string& namespaceOut);
132
133MCAPI float FoodSaturationFromString(::std::string const& str);
134
135MCAPI ::std::unordered_map<::std::string, ::ActorFactoryData>& GetActorDataRegistry();
136
137MCAPI double GetEngagementMetricsTimeSinceAppStart_DEPRECATED();
138
139MCAPI void Internal_HCTraceMessage(char const*, ::HCTraceLevel, char const*);
140
141MCAPI uint64 Internal_ThisThreadId();
142
143MCAPI ::std::optional<::LogLevel> LogLevelFromString(::std::string const& str);
144
145MCFOLD bool MOCK_ASSERT_HANDLER(::AssertHandlerContext const& context);
146
147MCAPI bool MOCK_ASSERT_HANDLER_NO_THROW(::AssertHandlerContext const& context);
148
149MCAPI bool Mock_Internal_HCHttpCallPerformAsync(::HC_CALL*);
150
151MCAPI long Mock_Internal_ReadRequestBodyIntoMemory(::HC_CALL*, ::std::vector<uchar, ::http_stl_allocator<uchar>>*);
152
153MCAPI void PlatformBedrockLogOut(uint _priority, char const* buf, uint64 nullTerminatorPos);
154
155MCAPI ::std::string StringFromCreativeItemCategory(::CreativeItemCategory category);
156
157MCAPI ::std::string StringFromMaterialType(::MaterialType const& materialType);
158
159MCAPI ::SharedTypes::Legacy::UseAnimation UseAnimationFromString(::std::string const& str);
160
161MCAPI void _addEnvironmentSubfilter(
162 ::std::string const& legacyPredicate,
163 ::FilterGroup::CollectionType filterName,
164 ::std::string const& op,
165 ::SharedTypes::Legacy::FilterSubject process,
166 ::FilterOperator type,
167 ::ActorFilterGroup::Processing subject
168);
169
170MCAPI void _addLegacyFilterDefinition(
171 ::std::string const& legacyPredicate,
172 ::FilterGroup::CollectionType type,
173 ::std::string const& filterName,
174 ::SharedTypes::Legacy::FilterSubject subject,
175 ::FilterOperator op,
176 ::ActorFilterGroup::Processing process
177);
178
179MCAPI void _checkTickedActorsForOutOfWorld(::ActorOwnerComponent& actorOwnerComponent);
180
181MCAPI ::std::unique_ptr<::ListTag> _createBlockStateEnum(::BlockState const& state);
182
183MCAPI uchar _facingToDirection(uchar facing);
184
185MCAPI uint _facingToVineDirection(uchar facing);
186
187MCAPI ::ScatterParamsMolangVariableIndices& _getScatterParamsMolangVariableIndices();
188
189MCAPI bool _hasAirBuffer(::Json::Value const& blockLayers);
190
191MCAPI ::Block const* _loadLayerBlock(::Json::Value const& layer);
192
193MCAPI ::std::optional<::BlockPos> _locateBiome(
194 ::std::function<bool(::Biome const&)> const& predicate,
195 ::BiomeArea const& biomeArea,
196 ::BlockPos worldCenter,
197 ::BoundingBox worldBounds,
198 uint resolution
199);
200
201MCAPI ::std::optional<::std::vector<::BlockLayer>>
202_parseLayersV3(::Json::Value const& root, ::LevelData const& levelData);
203
204MCAPI ::std::optional<::std::vector<::BlockLayer>>
205_parseLayersV4(::Json::Value const& root, ::LevelData const& levelData);
206
207MCAPI ::std::optional<::std::vector<::BlockLayer>>
208_parseLayersV5(::Json::Value const& root, ::LevelData const& levelData);
209
210MCAPI ::std::optional<::std::vector<::BlockLayer>>
211_parseLayersV6(::Json::Value const& root, ::LevelData const& levelData, ::WorldVersion worldVersion);
212
213MCAPI ::std::unique_ptr<::ListTag> _saveBlockList(::std::vector<::BlockLegacy const*> const& blockList);
214
215MCAPI void
216_tickBribeableComponent(::ActorOwnerComponent& actorOwnerComponent, ::BribeableComponent& bribeableComponent);
217
218MCAPI void bindCreativeItemCategoryType(::cereal::ReflectionCtx& ctx);
219
220MCAPI void bindMaterialType(::cereal::ReflectionCtx& ctx);
221
222MCAPI char const* blockSlotToString(::BlockSlot slot);
223
224MCAPI ::KeyOrNameResult
225buildActorDisplayName(::ActorType actorType, ::std::string const& nameTag, ::Actor const* actor);
226
227MCAPI void checkComponent(
228 ::CircuitSceneGraph& graph,
229 ::CircuitComponentList& powerAssociationMap,
230 ::CircuitComponentType typeId,
231 uchar id,
232 ::BlockPos const& otherPos,
234 ::std::queue<::CircuitTrackingInfo, ::std::deque<::CircuitTrackingInfo>>& positions,
235 bool goingDown
236);
237
238MCAPI bool checkTypeFilter(
239 ::ActorDefinitionIdentifier const& entityIdentifier,
240 ::ActorDefinitionIdentifier const& identifierFilter
241);
242
243MCAPI void compoundBlockVolumeActionBindType(::cereal::ReflectionCtx& ctx);
244
245MCAPI void compoundBlockVolumePositionRelativityBindType(::cereal::ReflectionCtx& ctx);
246
247MCAPI void configureThread(::ThreadConfiguration const& config);
248
249MCAPI ::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>
250createUniqueRakPeer(::RakNet::RakPeerConfiguration const& config);
251
252MCAPI ::Bedrock::NonOwnerPointer<::WorkerPool> createWorkerPool(
253 ::std::string_view name,
254 ::WorkerConfiguration const& config,
255 ::std::shared_ptr<::Bedrock::WorkerPoolHandleInterface>& destHandle
256);
257
258MCAPI void doSendPacket(
259 ::StrictEntityContext const& entity,
260 ::MobOnPlayerJumpRequestComponent const& mobOnPlayerJumpRequestComponent,
262);
263
264MCAPI ::ActorCategory entityCategoriesFromString(::std::string const& str);
265
266MCAPI ::ActorCategory entityCategoryFromString(::std::string const& str);
267
268MCAPI ::srtp_err_status_t external_crypto_init();
269
270MCAPI ::srtp_err_status_t external_hmac_alloc(::srtp_auth_t**, int, int);
271
272MCAPI ::srtp_err_status_t external_hmac_compute(void*, uchar const*, int, int, uchar*);
273
274MCAPI ::srtp_err_status_t external_hmac_dealloc(::srtp_auth_t*);
275
276MCAPI ::srtp_err_status_t external_hmac_init(void*, uchar const*, int);
277
278MCAPI ::srtp_err_status_t external_hmac_start(void*);
279
280MCAPI ::srtp_err_status_t external_hmac_update(void*, uchar const*, int);
281
282MCAPI int fclose(::Core::File& file);
283
284MCAPI ::LeashFenceKnotActor* findKnotAt(::BlockSource& region, ::BlockPos const& pos);
285
286MCAPI void forEachEntityType(::std::function<bool(::ActorType, ::std::string const&)> callback);
287
288MCAPI uint64 fread(void* buffer, uint64 size, uint64 count, ::Core::File& file);
289
290MCAPI int fseek(::Core::File& file, int64 offset, int origin);
291
292MCAPI ::std::string gatherTypeStrings(::std::vector<::Json::ValueType> const& types);
293
294MCAPI ::std::string const getEdition();
295
296MCAPI ::FileType getFileType(::Core::PathView filePath, ::IFileAccess& fileAccess);
297
298MCAPI ::I18n& getI18n();
299
300MCAPI ::std::string getJsonTypeString(::Json::ValueType const& type);
301
302MCAPI ::std::string join(::std::string prefix, ::std::string_view chunkKey);
303
304MCAPI ::std::string join(::std::string_view prefix, ::LevelChunkTag tag);
305
306MCAPI ::std::string join(::std::string_view prefix, ::LevelChunkTag i, uint tag);
307
308MCAPI bool operator<(
311);
312
313MCAPI bool operator<(
316);
317
318MCAPI bool operator<(
321);
322
323MCAPI bool operator==(::DefinitionTrigger const& a, ::DefinitionTrigger const& b);
324
325MCAPI bool operator==(
328);
329
330MCAPI bool operator==(
333);
334
335MCAPI ::BlockProperty operator|(::BlockProperty lhs, ::BlockProperty b);
336
337MCAPI void renderMapChunk(
338 ::Dimension& dimension,
340 uint scale,
341 ::BlockPos const& origin,
343);
344
345MCAPI ::ItemInstance toItemInstance(::RecipeIngredient const& ingredient);
346
347MCAPI ::leveldb::Status toLevelDbStatus(::Core::Result const& result);
348
349MCAPI ::std::string toString(::AgentActionType type);
350
351MCAPI ::http_wstring utf16_from_utf8(::http_string const&);
352
353MCAPI ::http_wstring utf16_from_utf8(char const*);
354
355MCAPI ::http_wstring utf16_from_utf8(char const*, uint64);
356
357MCAPI ::http_string utf8_from_utf16(::http_wstring const&);
358
359MCAPI ::http_string utf8_from_utf16(wchar_t const*, uint64);
360// NOLINTEND
361
362// static variables
363// NOLINTBEGIN
364MCAPI ::std::vector<::HudElement> const& ALL_HUD_ELEMENTS();
365
366MCAPI ::std::unordered_map<
367 ::glTF::Accessor::Type,
368 ::std::string,
370 ::std::equal_to<::glTF::Accessor::Type>> const&
371AccessorTypeEnumMap();
372
373MCAPI ::HashedString const& BLAST_FURNACE_TAG();
374
375MCAPI ::HashedString const& CAMPFIRE_TAG();
376
377MCAPI ::std::unordered_map<::ContainerEnumName, ::std::string>& ContainerCollectionNameMap();
378
379MCAPI ::std::unordered_map<::ActorType, ::ActorMapping>& ENTITY_TYPE_MAP();
380
381MCAPI ::HashedString const& FURNACE_TAG();
382
383MCAPI ::std::array<::std::pair<::HudElement, ::std::string>, 13> const& HUD_ELEMENTS_TO_STRINGS();
384
385MCAPI ::GatheringServerInfo const& INVALID_GATHERING_SERVER_INFO();
386
387MCAPI ::ThirdPartyInfo const& INVALID_THIRD_PARTY_INFO();
388
389MCAPI char const*& IPV4_LOOPBACK();
390
391MCAPI char const*& IPV6_LOOPBACK();
392
393MCAPI ::std::unordered_map<
394 ::glTF::Image::ImageMimeType,
395 ::std::string,
397 ::std::equal_to<::glTF::Image::ImageMimeType>> const&
398ImageMimeTypeEnumMap();
399
400MCAPI ::MCRESULT const& MCRESULT_AllTargetsWillFail();
401
402MCAPI ::MCRESULT const& MCRESULT_ChatMuted();
403
404MCAPI ::MCRESULT const& MCRESULT_CommandExecIncomplete();
405
406MCAPI ::MCRESULT const& MCRESULT_CommandNotFound();
407
408MCAPI ::MCRESULT const& MCRESULT_CommandRequestInitiated();
409
410MCAPI ::MCRESULT const& MCRESULT_CommandStepDone();
411
412MCAPI ::MCRESULT const& MCRESULT_CommandStepFail();
413
414MCAPI ::MCRESULT const& MCRESULT_CommandVersionMismatch();
415
416MCAPI ::MCRESULT const& MCRESULT_CommandsDisabled();
417
418MCAPI ::MCRESULT const& MCRESULT_EncryptionRequired();
419
420MCAPI ::MCRESULT const& MCRESULT_ExecutionFail();
421
422MCAPI ::MCRESULT const& MCRESULT_ExpectedRequestMsg();
423
424MCAPI ::MCRESULT const& MCRESULT_FailWithoutFailMsg();
425
426MCAPI ::MCRESULT const& MCRESULT_FailedToParseCommand();
427
428MCAPI ::MCRESULT const& MCRESULT_InvalidCommandCall();
429
430MCAPI ::MCRESULT const& MCRESULT_InvalidCommandContext();
431
432MCAPI ::MCRESULT const& MCRESULT_InvalidCommandOrigin();
433
434MCAPI ::MCRESULT const& MCRESULT_InvalidOverloadSyntax();
435
436MCAPI ::MCRESULT const& MCRESULT_MalformedRequest();
437
438MCAPI ::MCRESULT const& MCRESULT_MustSpecifyVersion();
439
440MCAPI ::MCRESULT const& MCRESULT_NewCommandVersionAvailable();
441
442MCAPI ::MCRESULT const& MCRESULT_NoChatPermissions();
443
444MCAPI ::MCRESULT const& MCRESULT_NoTargetsFound();
445
446MCAPI ::MCRESULT const& MCRESULT_NotEnoughPermissions();
447
448MCAPI ::MCRESULT const& MCRESULT_Success();
449
450MCAPI ::MCRESULT const& MCRESULT_TooManyPendingRequests();
451
452MCAPI ::MCRESULT const& MCRESULT_VersionMismatch();
453
454MCAPI ::SemVersionConstant const& MIN_ENGINE_VERSION_MINIMUM_V2();
455
456MCAPI ::std::unordered_map<
457 ::glTF::Material::AlphaMode,
458 ::std::string,
460 ::std::equal_to<::glTF::Material::AlphaMode>> const&
461MaterialAlphaModeEnumMap();
462
463MCAPI ::std::bitset<38> const& PLAYER_ACTION_MOVEMENT_BITSET();
464
465MCAPI ::std::bitset<38> const& PLAYER_ACTION_MOVEMENT_SPEED_ATTRIBUTE_BITSET();
466
467MCAPI ::HashedString const& SMOKER_TAG();
468
469MCAPI ::HashedString const& SOUL_CAMPFIRE_TAG();
470
471MCAPI ::std::add_lvalue_reference_t<bool (*)(::AssertHandlerContext const&)> TEST_HANDLER();
472
473MCAPI ::std::add_lvalue_reference_t<bool (*)(::AssertHandlerContext const&)> TEST_HANDLER_NO_THROW();
474
475MCAPI ::std::unordered_map<
476 ::TextProcessingEventOrigin,
477 ::std::string,
479 ::std::equal_to<::TextProcessingEventOrigin>> const&
480TextProcessingEventOriginEnumMap();
481
482MCAPI ::std::array<::HashedString, 17> const& VanillaStructureFeatureTypes();
483
484MCAPI ::std::unordered_map<::std::string, ::ActorFilterGroup::LegacyMapping>& _environmentSubfilters();
485
486MCAPI ::std::unordered_map<::std::string, ::ActorFilterGroup::LegacyMapping>& _legacyPredicates();
487
488MCAPI ::std::unordered_map<int, ::std::string> const& discoveryEnvironmentLabels();
489
490MCAPI ::std::unordered_map<::std::string, ::DiscoveryEnvironment> const& discoveryEnvironmentStrings();
491
492MCAPI ::std::unordered_map<::DiscoveryEnvironment, ::std::string> const& discoveryEnvironments();
493
494MCAPI ::std::add_lvalue_reference_t<uint[]> englishCharacterFrequencies();
495
496MCAPI ::std::vector<::std::string>& gAreaFilters();
497
498MCAPI ::SubChunkDelayedDeleter<::SubChunkStorage<::Biome>>& gBiomeChunkGC();
499
500MCAPI ::SubChunkDelayedDeleter<::SubChunkStorage<::Block>>& gBlockStorageGC();
501
502MCAPI ::InternalTaskGroup& gInternalTaskGroup();
503
504MCAPI ::SubChunkDelayedDeleter<::SubChunkBrightnessStorage>& gLightStorageGC();
505
506MCAPI ::std::vector<::std::string>& gPriorityFilters();
507
508MCAPI ::std::add_lvalue_reference_t<void* (*)(uint64, uint)> g_memAllocFunc();
509
510MCAPI ::std::add_lvalue_reference_t<void (*)(void*, uint)> g_memFreeFunc();
511
512MCAPI ::HCTraceImplArea& g_traceHTTPCLIENT();
513
514MCAPI ::HCTraceImplArea& g_traceWEBSOCKET();
515
516MCAPI ::std::add_lvalue_reference_t<void (*)(char const*, long)> notifyOutOfMemory();
517
518MCAPI ::std::unordered_map<uint64, ::std::pair<::std::pair<::std::string, ::std::string>, ::std::string>>&
519preOptimizedHashes();
520
521MCAPI ::std::add_lvalue_reference_t<void (*)(void*, char const*, uint)> rakFree_Ex();
522
523MCAPI ::std::add_lvalue_reference_t<void* (*)(uint64, char const*, uint)> rakMalloc_Ex();
524
525MCAPI ::std::add_lvalue_reference_t<void* (*)(void*, uint64, char const*, uint)> rakRealloc_Ex();
526
527MCAPI ::std::add_lvalue_reference_t<::DynDnsResult[]> resultTable();
528
529MCAPI bool& s_AsyncLibEnablePumpingWait();
530
531MCAPI ::std::atomic<uint>& s_AsyncLibGlobalStateCount();
532
533MCAPI ::std::add_lvalue_reference_t<::TypeMapping[]> typeMappings();
534// NOLINTEND
Definition ActorOwnerComponent.h:10
Definition Actor.h:104
Definition BiomeArea.h:11
Definition Biome.h:27
Definition BlockLegacy.h:88
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition BlockState.h:11
Definition Block.h:36
Definition BoundingBox.h:18
Definition BribeableComponent.h:13
Definition CircuitComponentList.h:12
Definition CircuitSceneGraph.h:19
Definition CircuitTrackingInfo.h:14
Definition File.h:19
Definition PathView.h:16
Definition Result.h:17
Definition DefinitionTrigger.h:10
Definition Dimension.h:83
Definition EntityModifier.h:6
Definition GatheringServerInfo.h:5
Definition HashedString.h:5
Definition I18n.h:18
Definition IFileAccess.h:15
Definition InternalTaskGroup.h:18
Definition ItemInstance.h:16
Definition Value.h:16
Definition LeashFenceKnotActor.h:20
Definition LevelData.h:48
Definition ListTag.h:12
Definition RakPeerInterface.h:32
Definition RecipeIngredient.h:17
Definition Result.h:6
Definition SemVersionBase.h:6
Definition SemVersionConstant.h:8
Definition StrictEntityContext.h:10
Definition SubChunkBrightnessStorage.h:5
Definition ThirdPartyInfo.h:5
Definition WorkerPool.h:19
Definition _HeaderOutputPredefine.h:179
Definition http_stl_allocator.h:6
Definition AccessorTypeEnumHasher.h:5
Definition ActorDefinitionIdentifier.h:13
Definition ActorFactoryData.h:5
Definition ActorMapping.h:8
Definition AssertHandlerContext.h:5
Definition BlockLayer.h:5
Definition DynDnsResult.h:5
Definition HCTraceImplArea.h:5
Definition HC_CALL.h:16
Definition ImageMimeTypeEnumHasher.h:5
Definition KeyOrNameResult.h:5
Definition MCRESULT.h:8
Definition MapItemSavedData.h:41
Definition MaterialAlphaModeEnumHasher.h:5
Definition MobOnPlayerJumpRequestComponent.h:5
Definition RakPeerConfiguration.h:7
Definition ScatterParamsMolangVariableIndices.h:5
Definition SendPacketsComponent.h:11
Definition TextProcessingEventOriginEnumHasher.h:5
Definition ThreadConfiguration.h:5
Definition TypeMapping.h:5
Definition WorkerConfiguration.h:8
Definition buffer.h:5
Definition ReflectionCtx.h:11
Definition context.h:5
Definition ctx.h:5
Definition srtp_auth_t.h:5