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