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