LeviLamina
Loading...
Searching...
No Matches
LevelData.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/GameVersion.h"
7#include "mc/common/editor/WorldType.h"
8#include "mc/config/ChatRestrictionLevel.h"
9#include "mc/deps/core/sem_ver/SemVersion.h"
10#include "mc/deps/core/string/HashedString.h"
11#include "mc/deps/core/utility/NonOwnerPointer.h"
12#include "mc/deps/core/utility/pub_sub/Publisher.h"
13#include "mc/deps/core/utility/pub_sub/Subscription.h"
14#include "mc/deps/json/Value.h"
15#include "mc/deps/shared_types/legacy/Difficulty.h"
16#include "mc/network/GamePublishSetting.h"
17#include "mc/network/ServerEditorConnectionPolicy.h"
18#include "mc/options/EducationEditionOffer.h"
19#include "mc/options/EducationEditionOfferValue.h"
20#include "mc/platform/brstd/flat_map.h"
21#include "mc/world/actor/player/Abilities.h"
22#include "mc/world/actor/player/PermissionsHandler.h"
23#include "mc/world/level/BlockPos.h"
24#include "mc/world/level/DaylightCycle.h"
25#include "mc/world/level/GameType.h"
26#include "mc/world/level/GeneratorType.h"
27#include "mc/world/level/NetherWorldType.h"
28#include "mc/world/level/SpawnSettings.h"
29#include "mc/world/level/Tick.h"
30#include "mc/world/level/WorldVersion.h"
31#include "mc/world/level/levelgen/flat/FlatWorldPresetID.h"
32#include "mc/world/level/storage/AdventureSettings.h"
33#include "mc/world/level/storage/CloudSaveLevelInfo.h"
34#include "mc/world/level/storage/ExperimentStorage.h"
35#include "mc/world/level/storage/GameRules.h"
36#include "mc/world/level/storage/LevelDataProperty.h"
37#include "mc/world/level/storage/LevelDataType.h"
38#include "mc/world/level/storage/StorageVersion.h"
39#include "mc/world/level/storage/WorldTemplateLevelData.h"
40
41// auto generated forward declare list
42// clang-format off
43class BaseGameVersion;
44class CompoundTag;
46class LevelSeed64;
47class LevelSettings;
50struct LevelDataValue;
51namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
52namespace RakNet { class BitStream; }
53// clang-format on
54
55class LevelData {
56public:
57 // LevelData inner types define
59
60 using LevelDataPublisherRefWrapper = ::std::reference_wrapper<
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<1, 5, ::AdventureSettings> mAdventureSettings;
67 ::ll::TypedStorage<8, 144, ::WorldTemplateLevelData> mWorldTemplateLevelData;
68 ::ll::TypedStorage<8, 192, ::GameRules> mGameRules;
69 ::ll::TypedStorage<8, 72, ::ExperimentStorage> mExperiments;
70 ::ll::TypedStorage<4, 240, ::Abilities> mDefaultAbilities;
71 ::ll::TypedStorage<8, 24, ::PermissionsHandler> mDefaultPermissions;
72 ::ll::TypedStorage<8, 32, ::std::string> mLevelName;
73 ::ll::TypedStorage<4, 4, ::StorageVersion> mStorageVersion;
74 ::ll::TypedStorage<8, 56, ::GameVersion> mMinCompatibleClientVersion;
75 ::ll::TypedStorage<4, 4, int> mNetworkVersion;
76 ::ll::TypedStorage<8, 24, ::SemVersion> mInventoryVersion;
77 ::ll::TypedStorage<8, 8, ::Tick> mCurrentTick;
78 ::ll::TypedStorage<1, 1, bool> mHasSpawnPos;
79 ::ll::TypedStorage<4, 12, ::BlockPos> mLimitedWorldOrigin;
80 ::ll::TypedStorage<4, 4, int> mOverworldTimeSetting;
81 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::WorldClockRegistry const>> mWorldClockRegistry;
82 ::ll::TypedStorage<8, 8, int64> mLastSaved;
83 ::ll::TypedStorage<4, 4, uint> mServerTickRange;
84 ::ll::TypedStorage<4, 4, float> mRainLevel;
85 ::ll::TypedStorage<4, 4, int> mRainTime;
86 ::ll::TypedStorage<4, 4, float> mLightningLevel;
87 ::ll::TypedStorage<4, 4, int> mLightningTime;
88 ::ll::TypedStorage<4, 4, int> mNetherScale;
89 ::ll::TypedStorage<8, 56, ::GameVersion> mLastOpenedWithVersion;
90 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::Difficulty> mGameDifficulty;
91 ::ll::TypedStorage<1, 1, bool> mForceGameType;
92 ::ll::TypedStorage<1, 1, bool> mIsHardcore;
93 ::ll::TypedStorage<1, 1, bool> mPlayerHasDied;
94 ::ll::TypedStorage<1, 1, bool> mSpawnMobs;
95 ::ll::TypedStorage<1, 1, bool> mAdventureModeOverridesEnabled;
96 ::ll::TypedStorage<8, 16, ::Json::Value> mFlatWorldOptions;
97 ::ll::TypedStorage<4, 4, uint> mWorldStartCount;
98 ::ll::TypedStorage<1, 1, bool> mAchievementsDisabled;
99 ::ll::TypedStorage<4, 4, ::Editor::WorldType> mEditorWorldType;
100 ::ll::TypedStorage<1, 1, bool> mAllowAnonymousBlockDropsInEditorWorlds;
101 ::ll::TypedStorage<4, 4, ::ServerEditorConnectionPolicy> mServerEditorConnectionPolicy;
102 ::ll::TypedStorage<1, 1, bool> mIsCreatedInEditor;
103 ::ll::TypedStorage<1, 1, bool> mIsExportedFromEditor;
104 ::ll::TypedStorage<4, 4, ::EducationEditionOfferValue> mEducationEditionOffer;
105 ::ll::TypedStorage<8, 176, ::std::optional<::CloudSaveLevelInfo>> mCloudSaveInfo;
106 ::ll::TypedStorage<1, 1, bool> mEducationFeaturesEnabled;
107 ::ll::TypedStorage<1, 1, bool> mIsSingleUseWorld;
108 ::ll::TypedStorage<1, 1, bool> mConfirmedPlatformLockedContent;
109 ::ll::TypedStorage<1, 1, bool> mMultiplayerGameIntent;
110 ::ll::TypedStorage<1, 1, bool> mMultiplayerGame;
111 ::ll::TypedStorage<1, 1, bool> mLANBroadcastIntent;
112 ::ll::TypedStorage<1, 1, bool> mLANBroadcast;
113 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mXBLBroadcastIntent;
114 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mXBLBroadcastMode;
115 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mPlatformBroadcastIntent;
116 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mPlatformBroadcastMode;
117 ::ll::TypedStorage<1, 1, bool> mCheatsEnabled;
118 ::ll::TypedStorage<1, 1, bool> mCommandsEnabled;
119 ::ll::TypedStorage<1, 1, bool> mTexturePacksRequired;
120 ::ll::TypedStorage<1, 1, bool> mHasLockedBehaviorPack;
121 ::ll::TypedStorage<1, 1, bool> mHasLockedResourcePack;
122 ::ll::TypedStorage<1, 1, bool> mIsFromLockedTemplate;
123 ::ll::TypedStorage<1, 1, bool> mIsRandomSeedAllowed;
124 ::ll::TypedStorage<8, 32, ::std::string> mEducationProductId;
125 ::ll::TypedStorage<8, 32, ::std::string> mEducationCreatorId;
126 ::ll::TypedStorage<8, 32, ::std::string> mEducationCreatorWorldId;
127 ::ll::TypedStorage<8, 32, ::std::string> mEducationReferrerId;
128 ::ll::TypedStorage<1, 1, bool> mUseMsaGamertagsOnly;
129 ::ll::TypedStorage<1, 1, bool> mBonusChestEnabled;
130 ::ll::TypedStorage<1, 1, bool> mBonusChestSpawned;
131 ::ll::TypedStorage<1, 1, bool> mStartWithMapEnabled;
132 ::ll::TypedStorage<1, 1, bool> mMapsCenteredToOrigin;
133 ::ll::TypedStorage<1, 1, bool> mRequiresCopiedPackRemovalCheck;
134 ::ll::TypedStorage<1, 1, bool> mSpawnV1Villagers;
135 ::ll::TypedStorage<1, 1, bool> mPersonaDisabled;
136 ::ll::TypedStorage<1, 1, bool> mCustomSkinsDisabled;
137 ::ll::TypedStorage<1, 1, bool> mEmoteChatMuted;
138 ::ll::TypedStorage<1, 1, bool> mHasUncompleteWorldFileOnDisk;
139 ::ll::TypedStorage<1, 1, ::NetherWorldType> mNetherType;
140 ::ll::TypedStorage<8, 48, ::SpawnSettings> mSpawnSettings;
141 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::LevelDataValue>> mValues;
142 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::LevelDataValue>> mOverrides;
143 ::ll::TypedStorage<8, 32, ::std::string> mBiomeOverride;
144 ::ll::TypedStorage<4, 8, ::std::optional<::GeneratorType>> mDataDrivenGeneratorType;
145 ::ll::TypedStorage<1, 1, ::ChatRestrictionLevel> mChatRestrictionLevel;
146 ::ll::TypedStorage<
147 8,
148 8,
150 mIsHardcoreSubscribers;
151 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveLevelData;
152 ::ll::TypedStorage<
153 8,
154 48,
156 ::LevelDataProperty,
158 ::std::less<::LevelDataProperty>,
159 ::std::vector<::LevelDataProperty>,
160 ::std::vector<::std::unique_ptr<
162 mLevelDataPropertiesPublishers;
163 ::ll::TypedStorage<4, 4, ::LevelDataType> mLevelDataType;
164 // NOLINTEND
165
166public:
167 // prevent constructor by default
168 LevelData& operator=(LevelData const&);
169 LevelData(LevelData const&);
170 LevelData();
171
172public:
173 // member functions
174 // NOLINTBEGIN
175 MCAPI LevelData(::LevelData&& rhs);
176
177 MCAPI explicit LevelData(::CompoundTag const& tag);
178
179 MCAPI LevelData(bool isEduMode, ::LevelDataType levelDataType);
180
181 MCAPI LevelData(
182 ::LevelSettings const& settings,
183 ::std::string const& levelName,
184 ::GeneratorType generatorVersion,
185 ::BlockPos const& defaultSpawn,
186 bool achievementsDisabled,
187 ::EducationEditionOffer eduOffer,
188 float rainLevel,
189 float lightningLevel
190 );
191
192#ifdef LL_PLAT_C
193 MCAPI ::std::optional<::std::reference_wrapper<
195 _getLevelDataPropertyPublisher(::LevelDataProperty property) const;
196#endif
197
198 MCFOLD ::LevelDataValue const* _getValue(::HashedString const& key) const;
199
200 MCFOLD ::LevelDataValue* _getValue(::HashedString const& key);
201
202 MCAPI void _initLevelDataPropertyPublishers();
203
204#ifdef LL_PLAT_C
205 MCAPI void _resetDefaultAdvancedSettingsData(bool isTrial);
206
207 MCAPI void _resetDefaultGeneralSettingsData();
208
209 MCAPI void _resetDefaultMultiplayerSettingsData(bool isTrial);
210
211 MCAPI void _resetDefaultScriptingCodingSettingsData();
212
213 MCAPI void applyPolicyBasedSettings(bool hasBehaviourPack);
214#endif
215
216 MCAPI ::std::unique_ptr<::CompoundTag> createTag() const;
217
218 MCAPI void disableAchievements();
219
220 MCAPI ::BaseGameVersion const& getBaseGameVersion() const;
221
222 MCAPI ::std::string const getBiomeOverride() const;
223
224 MCAPI ::CompoundTag const& getEduSharedUriResource() const;
225
226 MCAPI ::GeneratorType getGenerator() const;
227
228 MCAPI void getTagData(::CompoundTag const& tag);
229
230 MCAPI bool hasCloudSaveAssociation() const;
231
232#ifdef LL_PLAT_C
233 MCAPI bool isCloudSaveActiveForWorld() const;
234
235 MCAPI bool isEditionCompatible() const;
236
237 MCAPI ::LevelData& operator=(::LevelData&& rhs);
238
239 MCAPI ::Bedrock::PubSub::Subscription registerIsHardcoreListener(::std::function<void(bool)> callback) const;
240
241 MCAPI ::Bedrock::PubSub::Subscription
242 registerLevelDataPropertyListener(::LevelDataProperty property, ::std::function<void()> callback) const;
243#endif
244
245 MCAPI void registerWithLevelStorageManagerEvents(::ILevelStorageManagerConnector& levelStorageManagerConnector);
246
247#ifdef LL_PLAT_C
248 MCAPI void resetDefaultCheatSettingsData();
249
250 MCAPI void resetSettingsForRandomSeed();
251#endif
252
253 MCAPI void setBiomeOverride(::std::string const& biomeName);
254
255 MCAPI void setCheatsEnabled(bool cheatsEnabled);
256
257#ifdef LL_PLAT_C
258 MCAPI void setCloudSaveInfo(::CloudSaveLevelInfo const& cloudSaveInfo);
259#endif
260
261 MCAPI void setCommandsEnabled(bool commandsEnabled);
262
263 MCAPI void setDaylightCycle(::DaylightCycle daylightCycle);
264
265 MCAPI void setEduSharedUriResource(::EduSharedUriResource const& eduSharedUriResource);
266
267 MCAPI void setEducationFeaturesEnabled(bool educationEnabled);
268
269#ifdef LL_PLAT_C
270 MCAPI void setFlatWorldPreset(::FlatWorldPresetID preset);
271#endif
272
273 MCAPI void setGameDifficulty(::SharedTypes::Legacy::Difficulty difficulty);
274
275 MCAPI void setGameType(::GameType type);
276
277 MCAPI void setGenerator(::GeneratorType version);
278
279 MCAPI void setIsHardcore(bool value);
280
281 MCAPI void setLevelName(::std::string const& levelName);
282
283 MCAPI void setMessUserId(::std::string const& messUserId);
284
285 MCAPI void setOverworldTimeSetting(int time);
286
287 MCAPI void setSeed(::LevelSeed64 seed);
288
289 MCAPI void setServerChunkTickRange(uint newRange);
290
291 MCAPI void setSpawnPos(::BlockPos const& spawn);
292
293 MCAPI void setTagData(::CompoundTag& tag) const;
294
295 MCAPI void setWorldClockRegistry(::Bedrock::NonOwnerPointer<::WorldClockRegistry const> registry);
296
297 MCAPI void setWorldTemplateOptionLocked(bool isLocked);
298
299 MCAPI void setWorldVersion(::WorldVersion version);
300
301#ifdef LL_PLAT_C
302 MCAPI bool shouldAchievementsBeDisabled(bool isTrialMode, bool hasBehaviourPack) const;
303#endif
304
305 MCAPI void touchLastLoadedWithVersion();
306
307#ifdef LL_PLAT_S
308 MCAPI void v1_read(::RakNet::BitStream& bitStream, ::StorageVersion storageVersion);
309#endif
310
311 MCAPI ~LevelData();
312 // NOLINTEND
313
314public:
315 // constructor thunks
316 // NOLINTBEGIN
317 MCAPI void* $ctor(::LevelData&& rhs);
318
319 MCAPI void* $ctor(::CompoundTag const& tag);
320
321 MCAPI void* $ctor(bool isEduMode, ::LevelDataType levelDataType);
322
323 MCAPI void* $ctor(
324 ::LevelSettings const& settings,
325 ::std::string const& levelName,
326 ::GeneratorType generatorVersion,
327 ::BlockPos const& defaultSpawn,
328 bool achievementsDisabled,
329 ::EducationEditionOffer eduOffer,
330 float rainLevel,
331 float lightningLevel
332 );
333 // NOLINTEND
334
335public:
336 // destructor thunk
337 // NOLINTBEGIN
338 MCAPI void $dtor();
339 // NOLINTEND
340};
Definition BaseGameVersion.h:8
Definition NonOwnerPointer.h:9
Definition Publisher.h:25
Definition BlockPos.h:17
Definition CloudSaveLevelInfo.h:10
Definition CompoundTag.h:18
Definition HashedString.h:5
Definition ILevelStorageManagerConnector.h:13
Definition LevelSeed64.h:5
Definition LevelSettings.h:38
Definition BitStream.h:7
Definition WorldClockRegistry.h:23
Definition flat_map.h:15
Definition EduSharedUriResource.h:10
Definition LevelDataValue.h:17